comparison src/gtkdialogs.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 e4e47871c373
children 74f6596fab78
comparison
equal deleted inserted replaced
12796:e8db8f94a2db 12797:eda1572c788b
884 bnode = cnode->child; 884 bnode = cnode->child;
885 cnode = cnode->next; 885 cnode = cnode->next;
886 while (bnode) { 886 while (bnode) {
887 GaimBuddy *buddy; 887 GaimBuddy *buddy;
888 if (GAIM_BLIST_NODE_IS_BUDDY(bnode)) { 888 if (GAIM_BLIST_NODE_IS_BUDDY(bnode)) {
889 GaimConversation *conv;
890 buddy = (GaimBuddy*)bnode; 889 buddy = (GaimBuddy*)bnode;
891 bnode = bnode->next; 890 bnode = bnode->next;
892 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM,
893 buddy->name,
894 buddy->account);
895 if (gaim_account_is_connected(buddy->account)) { 891 if (gaim_account_is_connected(buddy->account)) {
896 gaim_account_remove_buddy(buddy->account, buddy, group); 892 gaim_account_remove_buddy(buddy->account, buddy, group);
897 gaim_blist_remove_buddy(buddy); 893 gaim_blist_remove_buddy(buddy);
898 if (conv)
899 gaim_conversation_update(conv,
900 GAIM_CONV_UPDATE_REMOVE);
901 } 894 }
902 } else { 895 } else {
903 bnode = bnode->next; 896 bnode = bnode->next;
904 } 897 }
905 } 898 }
936 /* XXX - Some of this should be moved into the core, methinks. */ 929 /* XXX - Some of this should be moved into the core, methinks. */
937 static void 930 static void
938 gaim_gtkdialogs_remove_buddy_cb(GaimBuddy *buddy) 931 gaim_gtkdialogs_remove_buddy_cb(GaimBuddy *buddy)
939 { 932 {
940 GaimGroup *group; 933 GaimGroup *group;
941 GaimConversation *conv;
942 gchar *name; 934 gchar *name;
943 GaimAccount *account; 935 GaimAccount *account;
944 936
945 group = gaim_buddy_get_group(buddy); 937 group = gaim_buddy_get_group(buddy);
946 name = g_strdup(buddy->name); /* b->name is a crasher after remove_buddy */ 938 name = g_strdup(buddy->name); /* b->name is a crasher after remove_buddy */
949 gaim_debug_info("blist", "Removing '%s' from buddy list.\n", buddy->name); 941 gaim_debug_info("blist", "Removing '%s' from buddy list.\n", buddy->name);
950 /* TODO - Should remove from blist first... then call gaim_account_remove_buddy()? */ 942 /* TODO - Should remove from blist first... then call gaim_account_remove_buddy()? */
951 gaim_account_remove_buddy(buddy->account, buddy, group); 943 gaim_account_remove_buddy(buddy->account, buddy, group);
952 gaim_blist_remove_buddy(buddy); 944 gaim_blist_remove_buddy(buddy);
953 945
954 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, name, account);
955 if (conv != NULL)
956 gaim_conversation_update(conv, GAIM_CONV_UPDATE_REMOVE);
957
958 g_free(name); 946 g_free(name);
959 } 947 }
960 948
961 void 949 void
962 gaim_gtkdialogs_remove_buddy(GaimBuddy *buddy) 950 gaim_gtkdialogs_remove_buddy(GaimBuddy *buddy)
976 } 964 }
977 965
978 static void 966 static void
979 gaim_gtkdialogs_remove_chat_cb(GaimChat *chat) 967 gaim_gtkdialogs_remove_chat_cb(GaimChat *chat)
980 { 968 {
981 char *name = NULL;
982 GaimAccount *account;
983 GaimConversation *conv = NULL;
984
985 account = chat->account;
986
987 if (GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl)->get_chat_name != NULL)
988 name = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl)->get_chat_name(chat->components);
989
990 gaim_blist_remove_chat(chat); 969 gaim_blist_remove_chat(chat);
991
992 if (name != NULL) {
993 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, name, account);
994 g_free(name);
995 }
996
997 if (conv != NULL)
998 gaim_conversation_update(conv, GAIM_CONV_UPDATE_REMOVE);
999 } 970 }
1000 971
1001 void 972 void
1002 gaim_gtkdialogs_remove_chat(GaimChat *chat) 973 gaim_gtkdialogs_remove_chat(GaimChat *chat)
1003 { 974 {