diff src/server.c @ 8256:1d86096ae0f4

[gaim-migrate @ 8979] Tim Ringenbach says this shouldn't have gotten into 0.76, because 0.76 should have been release two weeks ago. He also doesn't have a good description, so I'll just say it fixed a bunch of idiot mistakes and ugly hacks on my part regarding the removing of users from the chat lists and parting chats/channels. Thanks Tim. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 14 Feb 2004 21:07:29 +0000
parents 4971193f761d
children 1fa30b3f7e6d
line wrap: on
line diff
--- a/src/server.c	Sat Feb 14 20:45:28 2004 +0000
+++ b/src/server.c	Sat Feb 14 21:07:29 2004 +0000
@@ -740,6 +740,12 @@
 		g_free(buffy);
 }
 
+/* Ya know, nothing uses this except gaim_conversation_destroy(),
+ * I think I'll just merge it into that later...
+ * Then again, something might want to use this, from outside prpl-land
+ * to leave a chat without destroying the conversation.
+ */
+
 void serv_chat_leave(GaimConnection *g, int id)
 {
 	GaimPluginProtocolInfo *prpl_info = NULL;
@@ -1364,7 +1370,8 @@
 	conv = gaim_conversation_new(GAIM_CONV_CHAT, account, name);
 	chat = GAIM_CONV_CHAT(conv);
 
-	gc->buddy_chats = g_slist_append(gc->buddy_chats, conv);
+	if (!g_slist_find(gc->buddy_chats, conv))
+		gc->buddy_chats = g_slist_append(gc->buddy_chats, conv);
 
 	gaim_conv_chat_set_id(chat, id);
 
@@ -1407,7 +1414,7 @@
 
 	g->buddy_chats = g_slist_remove(g->buddy_chats, conv);
 
-	gaim_conversation_destroy(conv);
+	gaim_conv_chat_left(GAIM_CONV_CHAT(conv));
 }
 
 void serv_got_chat_in(GaimConnection *g, int id, const char *who,