Mercurial > pidgin
diff finch/gntconn.c @ 20053:fb2880587f34
If there's a chat open when an account gets disconnected because of an error,
then try to rejoin that chat after the account gets back online. I'll see how
this goes here, if it goes well, we can do the same in pidgin. References #104.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 15 Sep 2007 09:53:30 +0000 |
parents | 41cad24fd6df |
children | 6bf32c9e15a7 |
line wrap: on
line diff
--- a/finch/gntconn.c Sat Sep 15 08:22:15 2007 +0000 +++ b/finch/gntconn.c Sat Sep 15 09:53:30 2007 +0000 @@ -104,10 +104,11 @@ { FinchAutoRecon *info; PurpleAccount *account = purple_connection_get_account(gc); - - info = g_hash_table_lookup(hash, account); + GList *list; if (!gc->wants_to_die) { + info = g_hash_table_lookup(hash, account); + if (info == NULL) { info = g_new0(FinchAutoRecon, 1); g_hash_table_insert(hash, account, info); @@ -140,6 +141,17 @@ g_free(secondary); purple_account_set_enabled(account, FINCH_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