diff -r 5d2fb40e4cdf -r a46be30427a6 finch/gntconv.c --- a/finch/gntconv.c Sat Sep 29 02:49:25 2007 +0000 +++ b/finch/gntconv.c Sat Sep 29 02:50:14 2007 +0000 @@ -311,13 +311,40 @@ static void account_signed_on_off(PurpleConnection *gc, gpointer null) { - GList *ims = purple_get_ims(); - while (ims) { - PurpleConversation *conv = ims->data; + GList *list = purple_get_ims(); + while (list) { + PurpleConversation *conv = list->data; PurpleConversation *cc = find_conv_with_contact(conv->account, conv->name); if (cc) generate_send_to_menu(cc->ui_data); - ims = ims->next; + list = list->next; + } + + if (PURPLE_CONNECTION_IS_CONNECTED(gc)) { + /* We just signed on. Let's see if there's any chat that we have open, + * and hadn't left before the disconnect. */ + list = purple_get_chats(); + while (list) { + PurpleConversation *conv = list->data; + PurpleChat *chat; + GHashTable *comps = NULL; + + list = list->next; + if (conv->account != gc->account || + !purple_conversation_get_data(conv, "want-to-rejoin")) + continue; + + chat = purple_blist_find_chat(conv->account, conv->name); + if (chat == NULL) { + if (PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) + comps = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, conv->name); + } else { + comps = chat->components; + } + serv_join_chat(gc, comps); + if (chat == NULL && comps != NULL) + g_hash_table_destroy(comps); + } } } @@ -738,7 +765,8 @@ gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), _(" "), GNT_TEXT_FLAG_BOLD); - if (who && *who && (flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV))) + if (who && *who && (flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV)) && + !(flags & PURPLE_MESSAGE_NOTIFY)) { char * name = NULL;