Mercurial > pidgin.yaz
comparison src/gtkconv.c @ 11815:821f40e1912f
[gaim-migrate @ 14106]
SF Patch #1336924 from sadrul
'From the wiki:
"If you have a tab open for a given contact, and then
drag an additional buddy into that contact, the send to
menu does not update."
This patch updates all the focused-conversations in
every window (note that not all conversation in every
tab). This wouldn't be necessary if it was possible to
tell which contact a buddy was removed from. But that
info is not available, so this is the way I can think of.
It works, and will probably not cause too much overhead
for most users -- assuming most of them use tabbed
convs and hence number of windows won't be too great.'
To track which contact was updated would be problematic, I think.
This doesn't seem like too much overhead to me and it keeps the code clean.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 25 Oct 2005 13:56:14 +0000 |
parents | b72ea98397c5 |
children | 908ff9b56e99 |
comparison
equal
deleted
inserted
replaced
11814:fa17fc619f17 | 11815:821f40e1912f |
---|---|
3798 } | 3798 } |
3799 | 3799 |
3800 return NULL; | 3800 return NULL; |
3801 } | 3801 } |
3802 | 3802 |
3803 static void | |
3804 buddy_update_cb(GaimBlistNode *bnode) | |
3805 { | |
3806 GList *list; | |
3807 | |
3808 g_return_if_fail(bnode); | |
3809 g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(bnode)); | |
3810 | |
3811 for (list = gaim_gtk_conv_windows_get_list(); list; list = list->next) | |
3812 { | |
3813 GaimGtkWindow *win = list->data; | |
3814 GaimConversation *conv = gaim_gtk_conv_window_get_active_conversation(win); | |
3815 | |
3816 if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) | |
3817 continue; | |
3818 | |
3819 gaim_conversation_update(conv, GAIM_CONV_ACCOUNT_ONLINE); | |
3820 } | |
3821 } | |
3822 | |
3803 /************************************************************************** | 3823 /************************************************************************** |
3804 * Conversation UI operations | 3824 * Conversation UI operations |
3805 **************************************************************************/ | 3825 **************************************************************************/ |
3806 void | 3826 void |
3807 gaim_gtkconv_new(GaimConversation *conv) | 3827 gaim_gtkconv_new(GaimConversation *conv) |
3894 gaim_account_get_protocol_name(conv->account)); | 3914 gaim_account_get_protocol_name(conv->account)); |
3895 | 3915 |
3896 g_signal_connect_swapped(G_OBJECT(pane), "focus", | 3916 g_signal_connect_swapped(G_OBJECT(pane), "focus", |
3897 G_CALLBACK(gtk_widget_grab_focus), | 3917 G_CALLBACK(gtk_widget_grab_focus), |
3898 gtkconv->entry); | 3918 gtkconv->entry); |
3919 | |
3920 if (conv_type == GAIM_CONV_TYPE_IM) | |
3921 { | |
3922 gaim_signal_connect(gaim_blist_get_handle(), "buddy-added", gtkconv, | |
3923 G_CALLBACK(buddy_update_cb), conv); | |
3924 gaim_signal_connect(gaim_blist_get_handle(), "buddy-removed", gtkconv, | |
3925 G_CALLBACK(buddy_update_cb), conv); | |
3926 } | |
3899 | 3927 |
3900 gaim_gtkconv_placement_place(gtkconv); | 3928 gaim_gtkconv_placement_place(gtkconv); |
3901 } | 3929 } |
3902 | 3930 |
3903 static void | 3931 static void |