20 Dec 2011 Kay   » (Journeyer)

Generic Jabber (XMPP) with webOS

WebOS (The operating system of the Palm Pre and Palm Pixi phones) has a built-in messaging application but unfortunately it only supports Google Talk and AIM out of the box. It's a shame that Palm has not enabled more protocols and especially generic XMPP support. The used library (libpurple) supports everything so it's only missing in the GUI.

Google Talk uses XMPP so in theory it should work with any other XMPP server but unfortunately Palm has put this nasty code in the LibpurpleAdapter (which is used as a connector between the GUI and the low-level libpurple):

if (strcmp(prplProtocolId, "prpl-jabber") == 0
    && g_str_has_suffix(transportFriendlyUserName, "@gmail.com") == FALSE
    && g_str_has_suffix(transportFriendlyUserName, "@googlemail.com") == FALSE)
{
    // Special case for gmail... don't try to connect to mydomain.com if the
    // username is me@mydomain.com. They might not have
    // setup the SRV record. Always connect to gmail. 
    purple_account_set_string(account, "connect_server", "talk.google.com");
}

This code means: If the protocol is Jabber (XMPP) and the entered username does NOT end with @gmail.com or @googlemail.com then the XMPP server is hardcoded to talk.google.com. So if you enter a username like johndoe@jabber.org then the Messaging app does not connect to jabber.org but instead it connects to talk.google.com because of the above code. So we must get rid of this code somehow.

With some knowledge about assembler you might be able to toggle some logic in the binary so the above if statement always evaluates to false but there is a much easier solution. You just need to replace the string "connect_server" with some invalid string. I use "nonnect_server". The result is that the line simply sets some unused property and therefore simply does nothing. But let me describe step by step:

Since WebOS 2 the LibpurpleAdapter program is renamed to imlibpurpletransport. In the following step-by-step instructions I will mention both variants for WebOS 1 and WebOS 2.


Continue reading "Generic Jabber (XMPP) with webOS"

Syndicated 2011-12-20 18:25:00 from K's cluttered loft

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!