changeset 368:9bf1f77985d2

[gaim-migrate @ 378] chat works properly now. it wasn't even working properly on the toc side, but the toc server was more lenient. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 09 Jun 2000 07:59:00 +0000
parents c457f47fbb1d
children cf895313fc50
files src/buddy_chat.c src/server.c
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy_chat.c	Thu Jun 08 07:04:58 2000 +0000
+++ b/src/buddy_chat.c	Fri Jun 09 07:59:00 2000 +0000
@@ -279,14 +279,15 @@
 
 static void close_callback(GtkWidget *widget, struct buddy_chat *b)
 {
-        serv_chat_leave(b->id);
-        
         if (b->window)
                 gtk_widget_destroy(b->window);
         b->window = NULL;
+        
+        serv_chat_leave(b->id);
 }
 
 
+
 static void whisper_callback(GtkWidget *widget, struct buddy_chat *b)
 {
 	char buf[BUF_LEN*4];
--- a/src/server.c	Thu Jun 08 07:04:58 2000 +0000
+++ b/src/server.c	Fri Jun 09 07:59:00 2000 +0000
@@ -548,8 +548,10 @@
 	GList *bcs = buddy_chats;
 	struct buddy_chat *b = NULL;
 	struct chat_connection *c = NULL;
+	int count = 0;
 
 	while (bcs) {
+		count++;
 		b = (struct buddy_chat *)bcs->data;
 		if (id == b->id)
 			break;
@@ -560,6 +562,10 @@
 	if (!b)
 		return;
 
+	sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n",
+				b->name, count);
+	debug_print(debug_buff);
+
 	aim_chat_leaveroom(gaim_sess, b->name);
 	c = find_oscar_chat(b->name);
 	if (c != NULL) {
@@ -568,6 +574,8 @@
 		g_free(c->name);
 		g_free(c);
 	}
+	/* we do this because with Oscar it doesn't tell us we left */
+	serv_got_chat_left(b->id);
 #endif
 }
 
@@ -950,8 +958,8 @@
         if (!b)
                 return;
 
-        if (b->window)
-                gtk_widget_destroy(GTK_WIDGET(b->window));
+	sprintf(debug_buff, "Leaving room %s.\n", b->name);
+	debug_print(debug_buff);
 
         buddy_chats = g_list_remove(buddy_chats, b);