pidgin: d0643697: Escape conversation title for use in inf...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Sun Mar 9 12:55:56 EDT 2008


-----------------------------------------------------------------
Revision: d0643697991f682f5e5690538d45225f6504c37e
Ancestor: 18604e6dad3cb38203b53cd872edd35abd764617
Author: nosnilmot at pidgin.im
Date: 2008-03-09T16:43:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d0643697991f682f5e5690538d45225f6504c37e

Modified files:
        ChangeLog pidgin/gtkconv.c

ChangeLog: 

Escape conversation title for use in infopane so that ampersands don't
generate invalid markup

-------------- next part --------------
============================================================
--- ChangeLog	969f913e4c6ec61bd94854813021c4f0727c6c98
+++ ChangeLog	29b81553fbfe99af7e1eeef267dc26481c7deadf
@@ -21,6 +21,8 @@ version 2.4.1 ():
 	* Remove a workaround for older versions gstreamer that was causing
 	  crashes on some non-Linux systems such as HPUX
 	* Fix some cases of the conversation input entry area being 1 pixel high
+	* Fix for displaying channel & buddy names in conversation window when
+	  they have '&' in them
 
 	Finch:
 	* Fix compiling with Glib older than 2.6
============================================================
--- pidgin/gtkconv.c	25483b5e36d0036da93930aa2ef90ae85a791e84
+++ pidgin/gtkconv.c	25b28a0e5bdaac0b5fd1f644061200d1f76ed77e
@@ -6494,14 +6494,16 @@ pidgin_conv_update_fields(PurpleConversa
 			}
 		} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
 			const char *topic = gtkconv->u.chat->topic_text ? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text)) : NULL;
-			char *esc = NULL;
+			char *esc = NULL, *tmp;
 #if GTK_CHECK_VERSION(2,6,0)
 			esc = topic ? g_markup_escape_text(topic, -1) : NULL;
 #else
 			/* GTK < 2.6 doesn't have auto ellipsization, so we do a crude
 			 * trucation to prevent forcing the window to be as wide as the topic */
 			int len = 0;
-			char *c, *tmp = g_strdup(topic);
+			char *c;
+
+			tmp = g_strdup(topic);
 			c = tmp;
 			while(*c && len < 72) {
 				c = g_utf8_next_char(c);
@@ -6516,11 +6518,12 @@ pidgin_conv_update_fields(PurpleConversa
 			esc = tmp ? g_markup_escape_text(tmp, -1) : NULL;
 			g_free(tmp);
 #endif
+			tmp = g_markup_escape_text(purple_conversation_get_title(conv), -1);
 			markup = g_strdup_printf("%s%s<span color='%s' size='smaller'>%s</span>",
-						purple_conversation_get_title(conv),
-						esc  && *esc ? "\n" : "",
+						tmp, esc  && *esc ? "\n" : "",
 						pidgin_get_dim_grey_string(gtkconv->infopane),
 						esc ? esc : "");
+			g_free(tmp);
 			g_free(esc);
 		}
 		gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter),


More information about the Commits mailing list