comparison src/gtkconv.c @ 12131:cb7ccb5048cf

[gaim-migrate @ 14431] SF Patch #1357001 from Sadrul "If you have a conversation-tab open, and you get disconnected (or reconnected), the tab does not update until you change focus to/from the tab. This patch fixes that." committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 18 Nov 2005 12:52:29 +0000
parents e75ef7aa913e
children 95bffda9b762
comparison
equal deleted inserted replaced
12130:5d9a74c47108 12131:cb7ccb5048cf
5056 type == GAIM_CONV_UPDATE_UNSEEN || 5056 type == GAIM_CONV_UPDATE_UNSEEN ||
5057 type == GAIM_CONV_UPDATE_TITLE) 5057 type == GAIM_CONV_UPDATE_TITLE)
5058 { 5058 {
5059 char *title; 5059 char *title;
5060 GaimConvIm *im = NULL; 5060 GaimConvIm *im = NULL;
5061 GaimConnection *gc = gaim_conversation_get_gc(conv); 5061 GaimAccount *account = gaim_conversation_get_account(conv);
5062 /* I think this is a little longer than it needs to be but I'm lazy. */ 5062 /* I think this is a little longer than it needs to be but I'm lazy. */
5063 char style[51]; 5063 char style[51];
5064 5064
5065 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM) 5065 if (gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_IM)
5066 im = GAIM_CONV_IM(conv); 5066 im = GAIM_CONV_IM(conv);
5067 5067
5068 if (!gc || ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT) 5068 if (!gaim_account_is_connected(account)
5069 || ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT)
5069 && gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)))) 5070 && gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv))))
5070 title = g_strdup_printf("(%s)", gaim_conversation_get_title(conv)); 5071 title = g_strdup_printf("(%s)", gaim_conversation_get_title(conv));
5071 else 5072 else
5072 title = g_strdup(gaim_conversation_get_title(conv)); 5073 title = g_strdup(gaim_conversation_get_title(conv));
5073 5074
5648 5649
5649 if (func == NULL) 5650 if (func == NULL)
5650 return; 5651 return;
5651 5652
5652 gaim_gtkconv_placement_set_current_func(func); 5653 gaim_gtkconv_placement_set_current_func(func);
5654 }
5655
5656 static void
5657 account_signed_off_cb(GaimConnection *gc, gpointer event)
5658 {
5659 GList *iter;
5660 GaimAccount *account;
5661
5662 account = gaim_connection_get_account(gc);
5663
5664 for (iter = gaim_get_conversations(); iter; iter = iter->next)
5665 {
5666 GaimConversation *conv = iter->data;
5667
5668 if (gaim_conversation_get_account(conv) == account)
5669 gaim_conversation_update(conv, GPOINTER_TO_INT(event));
5670 }
5653 } 5671 }
5654 5672
5655 void * 5673 void *
5656 gaim_gtk_conversations_get_handle(void) 5674 gaim_gtk_conversations_get_handle(void)
5657 { 5675 {
5775 5793
5776 /********************************************************************** 5794 /**********************************************************************
5777 * UI operations 5795 * UI operations
5778 **********************************************************************/ 5796 **********************************************************************/
5779 5797
5798 gaim_signal_connect(gaim_connections_get_handle(), "signed-on", handle,
5799 G_CALLBACK(account_signed_off_cb),
5800 GINT_TO_POINTER(GAIM_CONV_ACCOUNT_ONLINE));
5801 gaim_signal_connect(gaim_connections_get_handle(), "signed-off", handle,
5802 G_CALLBACK(account_signed_off_cb),
5803 GINT_TO_POINTER(GAIM_CONV_ACCOUNT_OFFLINE));
5804
5780 gaim_signal_connect(blist_handle, "buddy-added", handle, 5805 gaim_signal_connect(blist_handle, "buddy-added", handle,
5781 G_CALLBACK(buddy_update_cb), NULL); 5806 G_CALLBACK(buddy_update_cb), NULL);
5782 gaim_signal_connect(blist_handle, "buddy-removed", handle, 5807 gaim_signal_connect(blist_handle, "buddy-removed", handle,
5783 G_CALLBACK(buddy_update_cb), NULL); 5808 G_CALLBACK(buddy_update_cb), NULL);
5784 5809