Fix two edge-cases in handling command links: release-2.x.y

Tue, 05 Nov 2013 11:34:56 +0200

author
Andrew Victor <andrew.victor@mxit.com>
date
Tue, 05 Nov 2013 11:34:56 +0200
branch
release-2.x.y
changeset 34506
f161fc3074d1
parent 34505
af9d13b0f4e4
child 34507
979df20d7871
child 34514
46ba9c764edc

Fix two edge-cases in handling command links:
* "replymsg" field in named command contains URL-encoded text.
* "selmsg" field is included, but empty.

libpurple/protocols/mxit/formcmds.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/mxit/formcmds.c	Tue Nov 05 10:39:31 2013 +0200
+++ b/libpurple/protocols/mxit/formcmds.c	Tue Nov 05 11:34:56 2013 +0200
@@ -267,7 +267,7 @@
 
 	if (nm) {		/* indicates response must be a structured response */
 		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);
+		gchar*	replycmd = g_strdup_printf("type=reply|nm=%s|res=%s|err=0", nm, purple_url_decode(replymsg));
 
 		mxit_add_html_link( mx, replycmd, TRUE, seltext );
 
@@ -298,7 +298,7 @@
 	char*	dest;
 
 	selmsg = g_hash_table_lookup(hash, "selmsg");			/* find the selection message */
-	if (selmsg) {
+	if (selmsg && (strlen(selmsg) > 0)) {
 		text = g_markup_escape_text(purple_url_decode(selmsg), -1);
 	}
 

mercurial