pidgin/pidgin

Parents f2abd04191b7
Children b5243f46a31a
Fix an infinite loop when an account goes offline and you have an im open.

Testing Done:
Connected an account, opened an im, closed pidgin, verified it didn't hang.

Reviewed at https://reviews.imfreedom.org/r/763/
--- a/pidgin/gtkconv.c Fri Jun 18 00:00:00 2021 -0500
+++ b/pidgin/gtkconv.c Fri Jun 18 00:28:00 2021 -0500
@@ -4413,21 +4413,26 @@
/* We are about to sign off. See which chats we are currently in, and mark
* them for rejoin on reconnect. */
while(list != NULL) {
- PurpleConversation *conv = NULL;
-
- if(!PURPLE_IS_CHAT_CONVERSATION(list->data)) {
- continue;
- }
-
- conv = PURPLE_CONVERSATION(list->data);
- if (!purple_chat_conversation_has_left(PURPLE_CHAT_CONVERSATION(conv)) &&
- purple_conversation_get_account(conv) == account) {
- g_object_set_data(G_OBJECT(conv), "want-to-rejoin", GINT_TO_POINTER(TRUE));
- purple_conversation_write_system_message(conv,
- _("The account has disconnected and you are no "
- "longer in this chat. You will automatically "
- "rejoin the chat when the account reconnects."),
- PURPLE_MESSAGE_NO_LOG);
+ if(PURPLE_IS_CHAT_CONVERSATION(list->data)) {
+ PurpleConversation *conv;
+ PurpleChatConversation *chat;
+ gboolean left;
+
+ conv = PURPLE_CONVERSATION(list->data);
+ chat = PURPLE_CHAT_CONVERSATION(conv);
+ left = purple_chat_conversation_has_left(chat);
+
+ if(!left && purple_conversation_get_account(conv) == account) {
+ g_object_set_data(G_OBJECT(conv), "want-to-rejoin",
+ GINT_TO_POINTER(TRUE));
+
+ purple_conversation_write_system_message(
+ conv,
+ _("The account has disconnected and you are no longer in "
+ "this chat. You will automatically rejoin the chat when "
+ "the account reconnects."),
+ PURPLE_MESSAGE_NO_LOG);
+ }
}
list = g_list_delete_link(list, list);