comparison 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
comparison
equal deleted inserted replaced
12796:e8db8f94a2db 12797:eda1572c788b
2548 { N_("/Buddies/_Sort Buddies"), NULL, NULL, 0, "<Branch>", NULL }, 2548 { N_("/Buddies/_Sort Buddies"), NULL, NULL, 0, "<Branch>", NULL },
2549 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL }, 2549 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL },
2550 { N_("/Buddies/_Add Buddy..."), "<CTL>B", gaim_gtk_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD }, 2550 { N_("/Buddies/_Add Buddy..."), "<CTL>B", gaim_gtk_blist_add_buddy_cb, 0, "<StockItem>", GTK_STOCK_ADD },
2551 { N_("/Buddies/Add C_hat..."), NULL, gaim_gtk_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD }, 2551 { N_("/Buddies/Add C_hat..."), NULL, gaim_gtk_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD },
2552 { N_("/Buddies/Add _Group..."), NULL, gaim_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD }, 2552 { N_("/Buddies/Add _Group..."), NULL, gaim_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD },
2553 { "/Buddies/sep2", NULL, NULL, 0, "<Separator>", NULL }, 2553 { "/Buddies/sep3", NULL, NULL, 0, "<Separator>" },
2554 { N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT }, 2554 { N_("/Buddies/_Quit"), "<CTL>Q", gaim_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
2555 2555
2556 /* Accounts menu */ 2556 /* Accounts menu */
2557 { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL }, 2557 { N_("/_Accounts"), NULL, NULL, 0, "<Branch>", NULL },
2558 { N_("/Accounts/Add\\/Edit"), "<CTL>A", gaim_gtk_accounts_window_show, 0, "<StockItem>", GAIM_STOCK_ACCOUNTS }, 2558 { N_("/Accounts/Add\\/Edit"), "<CTL>A", gaim_gtk_accounts_window_show, 0, "<StockItem>", GAIM_STOCK_ACCOUNTS },
4211 } 4211 }
4212 } 4212 }
4213 4213
4214 static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node) 4214 static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node)
4215 { 4215 {
4216 if(!gtkblist) 4216 if(!gtkblist || !node)
4217 return; 4217 return;
4218 4218
4219 switch(node->type) { 4219 switch(node->type) {
4220 case GAIM_BLIST_GROUP_NODE: 4220 case GAIM_BLIST_GROUP_NODE:
4221 gaim_gtk_blist_update_group(list, node); 4221 gaim_gtk_blist_update_group(list, node);
4381 */ 4381 */
4382 4382
4383 c = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, data->account); 4383 c = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, data->account);
4384 if (c != NULL) { 4384 if (c != NULL) {
4385 gaim_buddy_icon_update(gaim_conv_im_get_icon(GAIM_CONV_IM(c))); 4385 gaim_buddy_icon_update(gaim_conv_im_get_icon(GAIM_CONV_IM(c)));
4386 gaim_conversation_update(c, GAIM_CONV_UPDATE_ADD);
4387 } 4386 }
4388 } 4387 }
4389 4388
4390 gtk_widget_destroy(data->window); 4389 gtk_widget_destroy(data->window);
4391 } 4390 }
4532 GHashTable *components; 4531 GHashTable *components;
4533 GList *tmp; 4532 GList *tmp;
4534 GaimChat *chat; 4533 GaimChat *chat;
4535 GaimGroup *group; 4534 GaimGroup *group;
4536 const char *group_name; 4535 const char *group_name;
4537 char *chat_name = NULL;
4538 GaimConversation *conv = NULL;
4539 const char *value; 4536 const char *value;
4540 4537
4541 components = g_hash_table_new_full(g_str_hash, g_str_equal, 4538 components = g_hash_table_new_full(g_str_hash, g_str_equal,
4542 g_free, g_free); 4539 g_free, g_free);
4543 4540
4573 } 4570 }
4574 4571
4575 if (chat != NULL) 4572 if (chat != NULL)
4576 { 4573 {
4577 gaim_blist_add_chat(chat, group, NULL); 4574 gaim_blist_add_chat(chat, group, NULL);
4578
4579 if (GAIM_PLUGIN_PROTOCOL_INFO(data->account->gc->prpl)->get_chat_name != NULL)
4580 chat_name = GAIM_PLUGIN_PROTOCOL_INFO(
4581 data->account->gc->prpl)->get_chat_name(chat->components);
4582
4583 if (chat_name != NULL) {
4584 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT,
4585 chat_name,
4586 data->account);
4587 g_free(chat_name);
4588 }
4589
4590 if (conv != NULL)
4591 gaim_conversation_update(conv, GAIM_CONV_UPDATE_ADD);
4592 } 4575 }
4593 4576
4594 gtk_widget_destroy(data->window); 4577 gtk_widget_destroy(data->window);
4595 g_free(data->default_chat_name); 4578 g_free(data->default_chat_name);
4596 g_list_free(data->entries); 4579 g_list_free(data->entries);
5012 } 4995 }
5013 4996
5014 static gboolean buddy_signonoff_timeout_cb(GaimBuddy *buddy) 4997 static gboolean buddy_signonoff_timeout_cb(GaimBuddy *buddy)
5015 { 4998 {
5016 struct _gaim_gtk_blist_node *gtknode = ((GaimBlistNode*)buddy)->ui_data; 4999 struct _gaim_gtk_blist_node *gtknode = ((GaimBlistNode*)buddy)->ui_data;
5017 GaimConversation *conv;
5018 5000
5019 gtknode->recent_signonoff = FALSE; 5001 gtknode->recent_signonoff = FALSE;
5020 gtknode->recent_signonoff_timer = 0; 5002 gtknode->recent_signonoff_timer = 0;
5021 5003
5022 gaim_gtk_blist_update(NULL, (GaimBlistNode*)buddy); 5004 gaim_gtk_blist_update(NULL, (GaimBlistNode*)buddy);
5023
5024 if((conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, buddy->name, buddy->account))) {
5025 if(GAIM_BUDDY_IS_ONLINE(buddy)) {
5026 gaim_conversation_update(conv, GAIM_CONV_ACCOUNT_ONLINE);
5027 } else {
5028 gaim_conversation_update(conv, GAIM_CONV_ACCOUNT_OFFLINE);
5029 }
5030 }
5031 5005
5032 return FALSE; 5006 return FALSE;
5033 } 5007 }
5034 5008
5035 static void buddy_signonoff_cb(GaimBuddy *buddy) 5009 static void buddy_signonoff_cb(GaimBuddy *buddy)