# HG changeset patch # User andrew.victor@mxit.com # Date 1274296892 0 # Node ID 985b57c4f55c6dc9e4fda1e699f339f8c88c2ec4 # Parent be01173f597a02f66a0ca56dd30f0865976aef69 Add support for the "nm=" syle of clickable links. This is needed for the newer MXit services (eg, Chess / tiXi) that use the Gaming markup. diff -r be01173f597a -r 985b57c4f55c libpurple/protocols/mxit/formcmds.c --- a/libpurple/protocols/mxit/formcmds.c Wed May 19 17:57:14 2010 +0000 +++ b/libpurple/protocols/mxit/formcmds.c Wed May 19 19:21:32 2010 +0000 @@ -206,10 +206,11 @@ /*------------------------------------------------------------------------ * Process a Clear MXit command. - * [::op=cmd|type=clear|clearmsgscreen=true|auto=true|id=12345:] + * [::op=cmd|type=clear|clearmsgscreen=true|auto=true|id=12345:] * - * @param session The MXit session object - * @param from The sender of the message. + * @param session The MXit session object + * @param from The sender of the message. + * @param hash The MXit command map */ static void command_clear(struct MXitSession* session, const char* from, GHashTable* hash) { @@ -234,6 +235,8 @@ /*------------------------------------------------------------------------ * Process a Reply MXit command. + * [::op=cmd|type=reply|replymsg=back|selmsg=b) Back|id=12345:] + * [::op=cmd|nm=rep|type=reply|replymsg=back|selmsg=b) Back|id=12345:] * * @param mx The received message data object * @param hash The MXit command map @@ -242,10 +245,21 @@ { char* replymsg; char* selmsg; + char* nm; selmsg = g_hash_table_lookup(hash, "selmsg"); /* find the selection message */ replymsg = g_hash_table_lookup(hash, "replymsg"); /* find the reply message */ - if ((selmsg) && (replymsg)) { + nm = g_hash_table_lookup(hash, "nm"); /* name parameter */ + if ((selmsg) && (replymsg) && (nm)) { + gchar* seltext = g_markup_escape_text(purple_url_decode(selmsg), -1); + gchar* replycmd = g_strdup_printf("::type=reply|nm=%s|res=%s|err=0:", nm, replymsg); + + mxit_add_html_link( mx, replycmd, seltext ); + + g_free(seltext); + g_free(replycmd); + } + else if ((selmsg) && (replymsg)) { gchar* seltext = g_markup_escape_text(purple_url_decode(selmsg), -1); mxit_add_html_link( mx, purple_url_decode(replymsg), seltext );