diff src/gtkblist.c @ 12797:eda1572c788b

[gaim-migrate @ 15144] SF Patch #1390008 from Sadrul "GaimGtkConv: Update tab icons, and some other small changes" This seems to make the Send To menu update better. I haven't seen this patch make anything worse yet, so I'm committing it. If you start seeing weird update errors, let Sadrul or me know. I thought I had a case of the Send To menu not updating even with this patch, but I haven't yet been able to duplicate it. Sadrul's description: '1. Fixes the tab-icons/send-to menu updates by listening for the appropriate signals. This patch removes the "updated" field from conversation-uiops. There is an existing "-updated" signal which can replace the uiops. 2. If having conversations with more than one accounts of a contact, and the buddy-icon of an inactive account is changed, then the new icon is showed (I think), even though it is not the buddy icon for the currently active conversation. This patch fixes that. 3. Emit "buddy-typing" and "-stopped" signal whenever the typing-state is changed. Currently, the typing-state of a conversation is sometimes changed without emitting the signal. This patch fixes that.' I rejected #4. '5. Emits the "chat-left" signal *after* setting "chat->left" to TRUE. 6. Show a buddy for an account only once in the SendTo menu (currently Gaim shows the same buddy more than once if the buddy exists in more than one groups). This is done by keeping a list of GaimPresence -- since that's the only thing the blist-nodes for the same buddy share.' committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 09 Jan 2006 21:29:53 +0000
parents 42af52cb61f7
children 6234099a4b37
line wrap: on
line diff
--- a/src/gtkblist.c	Mon Jan 09 16:04:04 2006 +0000
+++ b/src/gtkblist.c	Mon Jan 09 21:29:53 2006 +0000
@@ -2550,7 +2550,7 @@
 	{ N_("/Buddies/_Add Buddy..."), "<CTL>B", gaim_gtk_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD },
 	{ N_("/Buddies/Add C_hat..."), NULL, gaim_gtk_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD },
 	{ N_("/Buddies/Add _Group..."), NULL, gaim_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD },
-	{ "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL },
+	{ "/Buddies/sep3", NULL, NULL, 0, "<Separator>" },
 	{ N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT }, 
 
 	/* Accounts menu */
@@ -4213,7 +4213,7 @@
 
 static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node)
 {
-	if(!gtkblist)
+	if(!gtkblist || !node)
 		return;
 
 	switch(node->type) {
@@ -4383,7 +4383,6 @@
 		c = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, data->account);
 		if (c != NULL) {
 			gaim_buddy_icon_update(gaim_conv_im_get_icon(GAIM_CONV_IM(c)));
-			gaim_conversation_update(c, GAIM_CONV_UPDATE_ADD);
 		}
 	}
 
@@ -4534,8 +4533,6 @@
 	GaimChat *chat;
 	GaimGroup *group;
 	const char *group_name;
-	char *chat_name = NULL;
-	GaimConversation *conv = NULL;
 	const char *value;
 
 	components = g_hash_table_new_full(g_str_hash, g_str_equal,
@@ -4575,20 +4572,6 @@
 	if (chat != NULL)
 	{
 		gaim_blist_add_chat(chat, group, NULL);
-
-		if (GAIM_PLUGIN_PROTOCOL_INFO(data->account->gc->prpl)->get_chat_name != NULL)
-			chat_name = GAIM_PLUGIN_PROTOCOL_INFO(
-							data->account->gc->prpl)->get_chat_name(chat->components);
-
-		if (chat_name != NULL) {
-			conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT,
-													   chat_name,
-													   data->account);
-			g_free(chat_name);
-		}
-
-		if (conv != NULL)
-			gaim_conversation_update(conv, GAIM_CONV_UPDATE_ADD);
 	}
 
 	gtk_widget_destroy(data->window);
@@ -5014,21 +4997,12 @@
 static gboolean buddy_signonoff_timeout_cb(GaimBuddy *buddy)
 {
 	struct _gaim_gtk_blist_node *gtknode = ((GaimBlistNode*)buddy)->ui_data;
-	GaimConversation *conv;
 
 	gtknode->recent_signonoff = FALSE;
 	gtknode->recent_signonoff_timer = 0;
 
 	gaim_gtk_blist_update(NULL, (GaimBlistNode*)buddy);
 
-	if((conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account))) {
-		if(GAIM_BUDDY_IS_ONLINE(buddy)) {
-			gaim_conversation_update(conv, GAIM_CONV_ACCOUNT_ONLINE);
-		} else {
-			gaim_conversation_update(conv, GAIM_CONV_ACCOUNT_OFFLINE);
-		}
-	}
-
 	return FALSE;
 }