im.pidgin.pidgin: 059bbed1800b0e716c6f26f531b4fe997c9e5ae2

markdoliner at pidgin.im markdoliner at pidgin.im
Sun Dec 2 16:55:55 EST 2007


-----------------------------------------------------------------
Revision: 059bbed1800b0e716c6f26f531b4fe997c9e5ae2
Ancestor: 74e8ed5c30497ec4b19d92b3de3ef99b844138cf
Author: markdoliner at pidgin.im
Date: 2007-12-02T21:46:32
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkconv.c

ChangeLog: 

Fix a few assertion failures:
* Don't cal gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text))
  if gtkconv->u.chat->topic_text is NULL, which happens for AIM group
  chats
* Don't allow double-clicking on the tab for an AIM group chat to set
  the topic because AIM doesn't support chat room topics
* Don't call gtk_entry_set_text(GTK_ENTRY(entry), text) when
  initializing the entry and text is NULL

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	fc64e427432ddc59b58692a981c3829139d159f4
+++ pidgin/gtkconv.c	55bed5830a8ddf70cf39ad7964fb8f3ec4e5bcb5
@@ -6476,7 +6476,7 @@ pidgin_conv_update_fields(PurpleConversa
 				markup = title;
 			}
 		} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
-			const char *topic = gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text));
+			const char *topic = gtkconv->u.chat->topic_text ? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text)) : NULL;
 			char *esc = NULL;
 #if GTK_CHECK_VERSION(2,6,0)
 			esc = topic ? g_markup_escape_text(topic, -1) : NULL;
@@ -8674,7 +8674,7 @@ alias_cb(GtkEntry *entry, gpointer user_
                                                  gtk_entry_get_text(entry));
 		}
 		serv_alias_buddy(buddy);
-	} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {	        
+	} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
 		gtk_entry_set_text(GTK_ENTRY(gtkconv->u.chat->topic_text), gtk_entry_get_text(entry));
 		topic_callback(NULL, gtkconv);
 	}
@@ -8685,7 +8685,7 @@ infopane_entry_activate(PidginConversati
 infopane_entry_activate(PidginConversation *gtkconv)
 {
 	GtkWidget *entry = NULL;
-        PurpleConversation *conv = gtkconv->active_conv;
+	PurpleConversation *conv = gtkconv->active_conv;
 	const char *text = NULL;
 
 	if (!GTK_WIDGET_VISIBLE(gtkconv->tab_label)) {
@@ -8701,9 +8701,21 @@ infopane_entry_activate(PidginConversati
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
 		PurpleBuddy *buddy = purple_find_buddy(gtkconv->active_conv->account, gtkconv->active_conv->name);
 		if (!buddy)
+			/* This buddy isn't in your buddy list, so we can't alias him */
 			return FALSE;
+
 		text = purple_buddy_get_contact_alias(buddy);
 	} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+		PurpleConnection *gc;
+		PurplePluginProtocolInfo *prpl_info = NULL;
+
+		gc = purple_conversation_get_gc(conv);
+		if (gc != NULL)
+			prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+		if (prpl_info && prpl_info->set_chat_topic == NULL)
+			/* This protocol doesn't support setting the chat room topic */
+			return FALSE;
+
 		text = purple_conv_chat_get_topic(PURPLE_CONV_CHAT(conv));
 	}
 
@@ -8722,10 +8734,9 @@ infopane_entry_activate(PidginConversati
 	g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(alias_cb), gtkconv);
 	g_signal_connect(G_OBJECT(entry), "focus-out-event", G_CALLBACK(alias_focus_cb), gtkconv);
 	g_signal_connect(G_OBJECT(entry), "key-press-event", G_CALLBACK(alias_key_press_cb), gtkconv);
-	
-	
 
-	gtk_entry_set_text(GTK_ENTRY(entry), text);
+	if (text != NULL)
+		gtk_entry_set_text(GTK_ENTRY(entry), text);
 	gtk_widget_show(entry);
 	gtk_widget_hide(gtkconv->infopane);
 	gtk_widget_grab_focus(entry);


More information about the Commits mailing list