libpurple/protocols/jabber/presence.c

changeset 18987
2036a94093c5
parent 18971
34b3eb14ea8f
child 18989
8d3322014cb8
--- a/libpurple/protocols/jabber/presence.c	Sun Jul 29 06:10:24 2007 +0000
+++ b/libpurple/protocols/jabber/presence.c	Sun Jul 29 07:01:13 2007 +0000
@@ -413,7 +413,8 @@
 
 			if(chat->conv) {
 				title = g_strdup_printf(_("Error in chat %s"), from);
-				serv_got_chat_left(js->gc, chat->id);
+				if (g_hash_table_size(chat->members) == 0)
+					serv_got_chat_left(js->gc, chat->id);
 			} else {
 				title = g_strdup_printf(_("Error joining chat %s"), from);
 			}
@@ -421,7 +422,9 @@
 			g_free(title);
 			g_free(msg);
 
-			jabber_chat_destroy(chat);
+			if (g_hash_table_size(chat->members) == 0)
+				/* Only destroy the chat if the error happened while joining */
+				jabber_chat_destroy(chat);
 			jabber_id_free(jid);
 			g_free(status);
 			g_free(room_jid);

mercurial