Skip to content

Categories:

GitHub updates

Today we managed to tie up quite a few loose ends. I have completed a README and some basic building guides on the GitHub project. Feel free to grab a copy of the code and have a go at compiling it. BedLamp has done some great work on the Windows compilation, and has managed to produce a 23mb (versus 40mb) binary. This compresses to 6.3mb including themes. Furthermore, we’ve managed to remove the silly (empty) command prompt which was present in our handin yesterday. I have also fixed a bug with the Gallery bot and the emoticon code. Currently, emoticons still do not load in Windows, but I think this is an access issue, rather than a coding issue as they appear in Firefox in the HTML logs.

If anybody is keen on getting a working binary from us (we have up-to-date copies for Linux/Windows and Mac), please give me a shout. I do not want to upload them just yet, but am happy t o make plans per-individual.

Posted in Articles, mxitc.

Tagged with , .


What we would have done with another day to handin

Our handin was.. interesting. Producing a binary (for Windows, read: exe) can be done in one of two ways – with either dynamic or static linking. Dynamic linking means we need to ship the DLL’s (QtGui4.dll, QtNetwork4.dll..) which total around 30mb. This isn’t too bad, considering they can be rar’d down quite nicely. However, in the interest of keeping things simple, we went for the static option.

The gist of static linking is: compile Qt statically, and then link the binary against the static libraries. Sounds peachy? Pity that Qt takes 2-3 hours to compile given the amazingly shittiness that is Windows compiling. 2-3 hours later, there was an error – a bug in Qt! BedLamp managed to track down the cause in a mailing list and we applied the patch (soon to be release as 4.5.2) by hand. Another couple of hours later, and we finally managed to produce a working Window executable.

However, this exe is 40mb, which is really unacceptable. This is because we linked against the whole of Qt, instead of just the parts we needed. This has other side effects, such as a console popping up when you start the program. While we managed to rar the exe down to 9.99mb for the handin, it’s still annoying that Windows managed to get the last laugh on us.

Another issue is that emoticons do not work on Windows. This is because the HTML img tags are being generated as C:/mxit/.. instead of file:///C/mxit/… This is another easy fix, but unfortunately it’s too late.

So – with another day (or couple of hours) to finalise our handin, we’d have liked to produce a much smaller binary (I’m confident we can get it down to under 10mb without compression, and then compression will take it down to 2-5mb) as well as have some time to double check everything worked on Windows.

If anybody is interested, you can checkout our code base. It is released under the GPLv3 license, and available on my GitHub account (mxitc and mxitc-themes). To get the code, either clone it with git, or GitHub provides a link to a tarball (or zip). To build, you will need a C++ compiler, the Qt libraries and cmake. At some point this week, I will clean up both repositories with decent README’s and installation instructions.

Posted in Articles, Competition, mxitc.

Tagged with , , , .


Handin

Do not attempt to adjust your set. This is a streaming freedom video bulletin. The cable hack will last exactly sixty seconds. It cannot be traced, it cannot be stopped, and it is the only free voice left in this city.

Day of “the Pulse” aside.. rumour has it that the mxit competition finished today! With 10 minutes to go, we found ourselves overjoyed that the Windows executable had finally finished compiling. However, the resulting 10mb just wasn’t going to fit down BedLamp’s 384k in time. With a dash of speed, raxter drive him and myself back to my place where we frantically attached source code, README’s and themes to the already 9mb rar file. The uploaded completed with just 2 minutes on the clock. Thank you 4mb.

Our final handin seems to work just as it does on Linux, although emoticons and scrolling are (reportedly, by a friend) buggy. We’re pretty happy/proud of the work we’ve done, and looking forward to seeing what else is out there. Our source code will be released sometime this week on GitHub, under the GPLv3 license. I encourage all other competitors to release your code (GitHub is a great place to do so) so that everybody can see what ya’ll have been up to – including future developers!

Peace out, yo.

Posted in Articles, Competition, mxitc.

Tagged with , .


Emoticons

It’s been a while since I gave a look at how we implemented a feature, so here’s a look at how I tackled emoticons.

I wanted an implementation which would (ultimately) require no coding to add emoticons. My vision was to be able to just add image files into a directory and for mxitc to just work. As you may know, mxitc gets its look and feel off a rather comprehensive theming engine. For more information, read here and here. This engine already implements the behavior I wanted, with one minor hitch: filenames. Usually the theming engine looks for a “contact/presence/online.png” by virtue of the fact that the contact’s presence is online. For an emoticon however, “:).png” (or worse) is just going to cause problems on most filesystems.

Enter the dictionary. This allows for spoken to shorthand translation. For example, “colon.rightbracket” is translated to “:)”. This dictionary allows us to (once-off) write a bunch of translations, and for everything else to work at run-time. The engine builds regular-expressions to replace the “:)” in the message to a HTML img tag, complete with a CSS class and ALT. If you remove the underlying emoticon image, the ALT will kick in, resulting in the original “:)” being displayed. Changing your theme (even at run-time) will result in all these tags being updated (or downgraded to plain text, if the new theme is missing some emoticons) to the new images. Best of all, this all works in HTML, so log files will have the emoticons as well.

Here is a working example.

  • Assume the dictionary contains entries for:
    • colon => :
    • rightbracket => )
    • lessthan => <
  • You could create an image in your theme’s emoticon directory for a generic “:)” smiley face
    • YOURTHEME/chat/emoticons/colon.rightbracket.png (or gif for animations..)
  • “:)” in chat will result in the image instead of the text
    • <img alt=”:)” src=”YOURTHEME/chat/emoticons/colon.rightbracket.png” class=”emoticon” />
  • Add another, more complicated emoticon such as “<:)” and click ‘reload theme’
    • YOURTHEME/chat/emoticons/lessthan.colon.rightbracket.png (or whatever image format you want)
  • “<:)” in chat will result in the party-style image you just added

I’m very happy with the way this turned out. It is very easy to add emoticon support/packs to the program. Get a picture, name it correctly and dump it in the right folder. In other news, raxter has created a (very shiny) first-run Wizard to help new users get their client up and running for the first time. He has also cleaned up the default layout, so that it looks more like a chat application than an operating system. Check out his blog when/if he gets around to writing about it.

Best of luck to everybody still involved in the competition – I look forward to seeing what everybody else has been up to!

Posted in Articles, Competition, mxitc.

Tagged with , , , , .


ICMP has its uses

This has nothing to do with the competition, but I thought I’d rant on quickly about people who block ICMP. To quote Wikipedia:

(ICMP) is one of the core protocols of the Internet Protocol Suite

MXit gateways (at least the ones I’ve seen) all block ICMP. This is not good! It is silly to just willy-nilly block off one of the core protocols of the Internet. A lot of people do it to avoid ping spamming and other sorts of idiocy.. but there are other (and better) ways of dealing with this.

So, to get to the point: mxit clients will not work behind a (trivial) firewall. Don’t believe me? Try it. Hook your phone up to your network and login. You may make it to the contact screen if you’re lucky, but thats about as far as you’ll get.

The reason has to do with MTU, or maximum tramission unit. By default, Ethernet runs with an MTU of 1500 bytes. PPPoE on the other hand, runs at 1492, because 8 bytes are reserved for the PPPoE header. If you own the PPPoE connection (e.g. you dialled up a connection on your computer, through your ADSL modem), then everything is peachy because your computer will use the correct MTU. However, if you’re going through a gateway (e.g. some sort of server on your network), things go horridly wrong.

The start of the trouble is that your computer (or cellphone) thinks its using Ethernet. It assumes an MTU of 1500. Now a login packet ain’t a problem because it’s small enough. However, as soon as bigger data (like a splash screen) starts flying around, we inevitably run into trouble. This is because the MXit gateway is sending units of 1500 bytes which are blocked at the ISP level because they can’t fit down the PPPoE link. The ISP then tries to issue an ICMP message to change this MTU to 1492. Yeah, you see the problem right? The MXit gateway blocks ICMP, resulting in catastrophic failure.

I mentioned that behind some routers you won’t get this problem. This is only because the router is clever enough to clamp the packet size to 1492.  Using iptables on Linux you can issue something like

iptables -A FORWARD -p tcp –tcp-flags SYN,RST SYN -j TCPMSS –clamp-mss-to-pmtu

and you’ll get the same result.

Just because you can make it work, doesn’t mean it’s OK! Not everybody has direct control over their firewall, nor should they need to know anything about what I’ve been rambling about.

I should mention, for the sake of completeness, that you can change your MTU on your Ethernet card to 1492 if you don’t have control over the firewall. In Linux you can do this per-connection with ifconfig and in Windows it requires some registry editing. With Mac, I guess it’s ifconfig as well, but I’m not sure if you can do it per-connection (Unix doesn’t support this by default as far as I’m aware).

Posted in Articles.

Tagged with , .


dozeeee

We’ve accomplished quite a lot this weekend, the most important being:

  • Group chat
  • System messages
  • HTTP Proxy’s
  • Hyperlink support for markup
  • Splash message (for login)

Every time we complete a major feature, we tag our code with a milestone and make sure everything still works cross platform. Group chat is our 3rd milestone, so here is an example of v0.3 running on Windows Vista using a Squid HTTP Proxy on LAN (with 15s polling).

mxitc 0.3 on Vista

mxitc 0.3 on Vista

Posted in Competition, mxitc.

Tagged with , , .


Compiling mxitc

Just for kicks, this is (more or less) what it looks like to compile the program. With single-core compiling it can take quite some time, but on a quad-core it rolls out in around 10s. The final binary size is around 800k, but this is with dynamic linking. For a Windows release, this size will go up a bit because the Qt libraries will be statically compiled into the exe. The default theme/skin is still under 1mb in size.

marc@saidin ~/workspace/cpp/mxit/build $ make
[  1%] Generating gui/moc_mxit_dock_widget.cxx
[  2%] Generating ui_add_contact.h
[  2%] Generating ui_contacts.h
[  3%] Generating ui_conversations.h
[  4%] Generating ui_debug.h
[  5%] Generating ui_log.h
[  6%] Generating ui_options.h
[  7%] Generating ui_update_contact_info.h
[  8%] Generating ui_allow_subscription.h
[  9%] Generating ui_login.h
[ 10%] Generating ui_mxitc.h
[ 11%] Generating network/moc_connection.cxx
[ 12%] Generating protocol/moc_handshaker.cxx
[ 13%] Generating mxit/moc_address_book.cxx
[ 14%] Generating mxit/moc_client.cxx
[ 14%] Generating mxit/moc_conversation.cxx
[ 15%] Generating mxit/moc_conversations.cxx
[ 16%] Generating gui/dock_widgets/moc_log.cxx
[ 17%] Generating gui/dock_widgets/moc_options.cxx
[ 18%] Generating gui/dock_widgets/moc_debug.cxx
[ 19%] Generating gui/dock_widgets/moc_conversations.cxx
[ 20%] Generating gui/dock_widgets/moc_contacts.cxx
[ 21%] Generating gui/dock_widgets/moc_add_contact.cxx
[ 22%] Generating gui/dialogs/moc_update_contact_info.cxx
[ 23%] Generating gui/dialogs/moc_login.cxx
[ 24%] Generating gui/dialogs/moc_allow_subscription.cxx
[ 25%] Generating gui/moc_mxitc.cxx
[ 26%] Generating gui/moc_mxit_dialog.cxx
[ 26%] Building CXX object src/CMakeFiles/mxitc.dir/common/hash_variables.cpp.o
[ 27%] Building CXX object src/CMakeFiles/mxitc.dir/network/packets/http.cpp.o
[ 28%] Building CXX object src/CMakeFiles/mxitc.dir/network/packets/tcp.cpp.o
[ 29%] Building CXX object src/CMakeFiles/mxitc.dir/network/packet.cpp.o
[ 30%] Building CXX object src/CMakeFiles/mxitc.dir/network/gateway.cpp.o
[ 31%] Building CXX object src/CMakeFiles/mxitc.dir/network/connection.cpp.o
[ 32%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/01_login.cpp.o
[ 33%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/02_logout.cpp.o
[ 34%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/03_getcontacts.cpp.o
[ 35%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/05_updatecontactinfo.cpp.o
[ 36%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/06_subscribetoanewcontact.cpp.o
[ 37%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/08_removecontact.cpp.o
[ 38%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/09_getnewmessages.cpp.o
[ 38%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/10_sendnewmessage.cpp.o
[ 39%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/11_register.cpp.o
[ 40%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/12_updateprofile.cpp.o
[ 41%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/17_polldifference.cpp.o
[ 42%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/26_getprofile.cpp.o
[ 43%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/27_getmultimediamessage.cpp.o
[ 44%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/29_renamegroup.cpp.o
[ 45%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/30_removegroup.cpp.o
[ 46%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/32_setshownpresenceandstatus.cpp.o
[ 47%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/33_blocksubscription.cpp.o
[ 48%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/34_sendmessagetogroup.cpp.o
[ 49%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/41_setmood.cpp.o
[ 50%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/43_loginkick.cpp.o
[ 51%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/44_createnewgroupchat.cpp.o
[ 51%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/45_addnewgroupchatmember.cpp.o
[ 52%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/51_getnewsubscription.cpp.o
[ 53%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/52_allowsubscription.cpp.o
[ 54%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/54_registergateway.cpp.o
[ 55%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/55_denysubscription.cpp.o
[ 56%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/56_unregistergateway.cpp.o
[ 57%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handlers/1k_keepalive.cpp.o
[ 58%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/aes.cpp.o
[ 59%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handler.cpp.o
[ 60%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/handshaker.cpp.o
[ 61%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/packet_header.cpp.o
[ 62%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/address_book.cpp.o
[ 63%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/client.cpp.o
[ 63%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/contact.cpp.o
[ 64%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/conversation.cpp.o
[ 65%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/conversations.cpp.o
[ 66%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/message.cpp.o
[ 67%] Building CXX object src/CMakeFiles/mxitc.dir/gui/theme_components/chat.cpp.o
[ 68%] Building CXX object src/CMakeFiles/mxitc.dir/gui/theme_components/contact/base.cpp.o
[ 69%] Building CXX object src/CMakeFiles/mxitc.dir/gui/theme_components/contact/presence.cpp.o
[ 70%] Building CXX object src/CMakeFiles/mxitc.dir/gui/theme_components/contact/type.cpp.o
[ 71%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/add_contact.cpp.o
[ 72%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/contacts.cpp.o
[ 73%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/conversations.cpp.o
[ 74%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/debug.cpp.o
[ 75%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/log.cpp.o
[ 76%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/options.cpp.o
[ 76%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dialogs/update_contact_info.cpp.o
[ 77%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dialogs/allow_subscription.cpp.o
[ 78%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dialogs/login.cpp.o
[ 79%] Building CXX object src/CMakeFiles/mxitc.dir/gui/mxitc.cpp.o
[ 80%] Building CXX object src/CMakeFiles/mxitc.dir/gui/mxit_dialog.cpp.o
[ 81%] Building CXX object src/CMakeFiles/mxitc.dir/gui/mxit_dock_widget.cpp.o
[ 82%] Building CXX object src/CMakeFiles/mxitc.dir/gui/theme.cpp.o
[ 83%] Building CXX object src/CMakeFiles/mxitc.dir/main.cpp.o
[ 84%] Building CXX object src/CMakeFiles/mxitc.dir/network/moc_connection.cxx.o
[ 85%] Building CXX object src/CMakeFiles/mxitc.dir/protocol/moc_handshaker.cxx.o
[ 86%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/moc_address_book.cxx.o
[ 87%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/moc_client.cxx.o
[ 88%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/moc_conversation.cxx.o
[ 88%] Building CXX object src/CMakeFiles/mxitc.dir/mxit/moc_conversations.cxx.o
[ 89%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/moc_log.cxx.o
[ 90%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/moc_options.cxx.o
[ 91%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/moc_debug.cxx.o
[ 92%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/moc_conversations.cxx.o
[ 93%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/moc_contacts.cxx.o
[ 94%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dock_widgets/moc_add_contact.cxx.o
[ 95%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dialogs/moc_update_contact_info.cxx.o
[ 96%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dialogs/moc_login.cxx.o
[ 97%] Building CXX object src/CMakeFiles/mxitc.dir/gui/dialogs/moc_allow_subscription.cxx.o
[ 98%] Building CXX object src/CMakeFiles/mxitc.dir/gui/moc_mxitc.cxx.o
[ 99%] Building CXX object src/CMakeFiles/mxitc.dir/gui/moc_mxit_dialog.cxx.o
[100%] Building CXX object src/CMakeFiles/mxitc.dir/gui/moc_mxit_dock_widget.cxx.o
Linking CXX executable mxitc
[100%] Built target mxitc

Quite the monster ;)

Posted in Articles, mxitc.

Tagged with , .


First and foremost a chat application

BedLamp’s last blog post mentioned how raxter and I hacked out all Contact/Conversation logic from the GUI and wrote modules for

  1. Adddress Book
  2. Contact
  3. Conversation
  4. Conversations
  5. Message

Since the functionality was previously embedded in the GUI, it took a full two days to refactor everything. The final result was so worth it. The GUI code is much much cleaner, and the modules themselves provide exceptional functionality and performance. The Address Book stores 4 hashes, enabling lightning quick lookups by address, and super fast ordering. All classes are able to handle raw MXit data, and they just work, emitting correct signals up to the GUI.

For example, throw a “get contacts” packet at the Address Book and it will either create or update Contacts based on it’s internal store. It will them emit a change set of Contacts which have been updated, enabling the GUI to capture this signal and redraw the relevant parts. In addition, the Conversations widget can also pick up this signal and do something clever (like marking a Conversation as being updated, because a Contact went offline).

Raxter has just finished changing the Contact view to a Tree View, which now groups Contacts. BedLamp reworked my Markup engine, and it now can handle more complex actions, such as escaping characters. I finished Conversation-view updates: everything is rendeder as HTML, and styled against the theme. This allows for an insane level of customization, as well as (and I think this is awesome) logging conversations in HTML for offline viewing.

Here are some 4am screenshots to give a visual idea of what I’m rambling about. The Conversation styling (italics, backgrounds..) are more just to demonstrate how flexible it is, rather than the final look-and-feel we want to go for.

Chatting with HTML styling done by theming engine

Chatting with HTML styling done by theming engine

Same functionality, no theme

Same functionality, no theme

HTML dumps of conversations

HTML dumps of conversations

Tomorrow we plan on wrapping things up with group chat and MXit commands.

Posted in Articles, Competition, mxitc.

Tagged with , , , .


NetProphet 2009

Today was the first NetProphet, “Making Business Sense of the Internet”, conference. Among the so-called Prophets (read: speakers) was Herman Heunis, co-founder of MXit. His presentation, “MXit – The Past, Present and Future“, spoke about the birth of MXit (initially planned as a MMOPG) as well as MXit’s roadmap into the future.  Heunis mentioned that the MXit PC Client was an absolute disaster and that MXit had launched the competition. He also mentioned that the competition had ~160 (if I remember correctly) entrants, some of which are from the Phillipines, where MXit has around a million (again, if I remember..) users. Word of mouth has it that an entry from the Phillipines has already presented a prototype which impressed MXit. So, for all involved in the competition, I encourage you to redouble your efforts for a South African winner! Another interesting fact was that there are reports of some users able to communicate with up to 40 contacts simultaneously (on MXit). This is really quite amazing, and something to consider when desiging the conversation management.

Heunis’ speech was very interesting – tonnes of useful figures and facts all round. Actually, that can be said about most of NetProphet. I thoroughly enjoyed the day and am, quite franky, astonished at the quality of the conference, especially given that it was free to attend. To everybody who didn’t/couldn’t make it: too bad? No, not really. From what I read on the Twitter fountain, all videos will be posted online after roughly a week of postprocessing. I encourage you to grab a copy when they’re available. I recommend checking out ” Lifting the Venture Capital Skirt” by Henk Kleynhans – a thorougly interested and well presented talk.

Posted in Articles.

Tagged with .


Managing contacts

One of the design nuggets by Dr. Drew was to think about how to manage contacts. If you’ve been reading our (BedLamp, marcb, raxter) blogs, you’ll know by now that we’ve taken a highly modular/granular approach to this project. Each concept is mapped to it’s own class, right down to each packet type.

So, how did we go about solving the questions posed by Dr. Drew? Up until today, we had all contact management floating around in the GUI code. This was making me unhappy, so today’s goal was to extract that logic into it’s own module. Nugget for nugget, here is a quick look at how this new module fares.

Can your users quickly find the contact they’re looking for? What if their contact list exceeds 1000 contacts?

MXit::AddressBook provides an abstraction for dealing with contacts. Contacts are stored in a QHash, where the hash key is the contactAddress (unique) and the value of that key is the actual MXit::Contact, a base class for constructing and managing a contact. Additionally, AddressBook uses a QMap which is a special type of hash – keys are ordered using a heap. The key in the map is actually a mixture of a numeric presence-rating and the contact’s addres. For example, if John is online, the QHash will store him as <”John”, Contact*>, while the QMap will store him as <”1john”, Contact*>.

This is a very lightweight solution to ordering contacts. The QHash allows for very fast lookups by contact address (mostly to check uniqueness to decided whether to insert a new contact or update an existing one), while the QMap allows for very fast ordering. Contact’s are stored as pointers, meaning that both structures will leave a small footprint in memory.

Can we find the contact they want? Absolutely, with O(1) time. Can we manage 1000+ contacts? Absolutely, and with O(logn) insertion time (at login) and O(1) update time (status changes).

What kind of filtering mechanism are you planning to use? Are you planning to use a flat, 1-dimensional list or perhaps something a bit more structured? Searching and grouping are two obvious approaches…..try think of something fresh.

Contacts are ordered first by presence, then by name. We currently have no support for groups, or searching. Watch this space!

How do you plan to keep your users informed about the various chat events that are taking place e.g. new messages, status changes etc.

We have seperated the concepts of contacts and conversations into just that: contacts and conversations. Double-clicking on a contact will not just open up a chat window to that contact. Rather, it will create a conversation with that contact. Conversations can contain an arbitrary number of contacts (e.g. group chat) and are managed from a seperate widget. As for notifications, we now have a system tray icon which pops up event notifications.

Finally, my plans for the new Message class are quite nifty, if I say so myself. I plan on mimicking a paging algorithm (used by Operating Systems to manage memory) so that extended conversations, or run time, doesn’t have a negative impact on your system. That is, old messages will fade out of memory and land up in a log file. If a user scolls up in the conversation these messages will be paged back into memory. This is also a nice step towards keeping message history, so that users can lookup old conversations.

As you can see, we are well on our way to having good contact management. One of the main areas we’ve been focusing on is to make the chat-side of the application as smooth as possible. This sounds kind of obvious, but it is important to not get let all the other features of MXit detract from it’s core: a chat application.

Posted in Articles, Competition, mxitc.

Tagged with , , .