pidgin.mxit: 78e3af0f: Add support for the "nm=" syle of clicka...

andrew.victor at mxit.com andrew.victor at mxit.com
Wed May 19 15:25:37 EDT 2010


-----------------------------------------------------------------
Revision: 78e3af0f2ea58ccb1518040be06d4f2f4090c04a
Ancestor: 9057cda222b1f28dff6197c088b6f2fe5a9a1a49
Author: andrew.victor at mxit.com
Date: 2010-05-19T19:21:32
Branch: im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/78e3af0f2ea58ccb1518040be06d4f2f4090c04a

Modified files:
        libpurple/protocols/mxit/formcmds.c

ChangeLog: 

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.


-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/formcmds.c	da3468a2b5e4ad80ff6bf9ded4c0a92f6ab853ce
+++ libpurple/protocols/mxit/formcmds.c	70dde3d6fb411b085a0dd9a3b385894cddb749d2
@@ -206,10 +206,11 @@ static GHashTable* command_tokenize(char
 
 /*------------------------------------------------------------------------
  * 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 <key,value> map
  */
 static void command_clear(struct MXitSession* session, const char* from, GHashTable* hash)
 {
@@ -234,6 +235,8 @@ static void command_clear(struct MXitSes
 
 /*------------------------------------------------------------------------
  * 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 <key,value> map
@@ -242,12 +245,23 @@ static void command_reply(struct RXMsgDa
 {
 	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 );
 
 		g_free(seltext);


More information about the Commits mailing list