xmpp.custom_smiley: aa40b9ad: When receiving an <img/> without the "al..

malu at pidgin.im malu at pidgin.im
Thu Sep 11 14:25:34 EDT 2008


-----------------------------------------------------------------
Revision: aa40b9ad8f9e94c4a3530669411f9e421ccbdc14
Ancestor: 90c3fd089e8c0f0acd6f0fda1f862fbfec2fcc2f
Author: malu at pidgin.im
Date: 2008-09-11T18:22:12
Branch: im.pidgin.xmpp.custom_smiley
URL: http://d.pidgin.im/viewmtn/revision/info/aa40b9ad8f9e94c4a3530669411f9e421ccbdc14

Modified files:
        libpurple/protocols/jabber/message.c

ChangeLog: 

When receiving an <img/> without the "alt" attribute, set
the "cid" including the "cid:" uri specifier to avoid
auto-linkification in gtkimhtml

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c	306b31c48906f4a3f333db8adafaa728378a5d79
+++ libpurple/protocols/jabber/message.c	85c8a5fc1a7c750dd2175b525235101b55a148b2
@@ -343,11 +343,12 @@ jabber_message_get_refs_from_xmlnode_int
 				JabberSmileyRef *ref = g_new0(JabberSmileyRef, 1);
 				const gchar *alt = xmlnode_get_attrib(child, "alt");
 				ref->cid = temp_cid;
-				/* if there is no "alt" string, use the cid... */
+				/* if there is no "alt" string, use the cid... 
+				 include the entire src, eg. "cid:.." to avoid linkification */
 				if (alt && alt[0] != '\0') {
 					ref->alt = g_strdup(xmlnode_get_attrib(child, "alt"));
 				} else {
-					ref->alt = g_strdup(cid);
+					ref->alt = g_strdup(src);
 				}
 				g_hash_table_insert(table, temp_cid, ref);
 			}
@@ -427,7 +428,7 @@ jabber_message_xml_to_string_strip_img_s
 					out = g_string_append(out, escaped);
 					g_free(escaped);
 				} else {
-					out = g_string_append(out, src + 4);
+					out = g_string_append(out, src);
 				}
 				pos += pos2 - pos;
 			} else {


More information about the Commits mailing list