diff -r 845d0a325350 -r 30e148be3e2c pidgin/gtkconn.c --- a/pidgin/gtkconn.c Wed Sep 19 10:07:03 2007 +0000 +++ b/pidgin/gtkconn.c Wed Sep 19 10:57:37 2007 +0000 @@ -141,6 +141,7 @@ { PurpleAccount *account = NULL; PidginAutoRecon *info; + GList *list; account = purple_connection_get_account(gc); info = g_hash_table_lookup(auto_reconns, account); @@ -192,6 +193,17 @@ */ purple_account_set_enabled(account, PIDGIN_UI, FALSE); } + + /* If we have any open chats, we probably want to rejoin when we get back online. */ + list = purple_get_chats(); + while (list) { + PurpleConversation *conv = list->data; + list = list->next; + if (conv->account != account || + purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) + continue; + purple_conversation_set_data(conv, "want-to-rejoin", GINT_TO_POINTER(TRUE)); + } } static void pidgin_connection_network_connected ()