mcabber/src/screen.c
changeset 1135 5d7c05932b13
parent 1133 9dd28a56128f
child 1137 5752017f6e2b
--- a/mcabber/src/screen.c	Sat Feb 03 18:31:55 2007 +0100
+++ b/mcabber/src/screen.c	Sat Feb 03 20:05:57 2007 +0100
@@ -1753,9 +1753,10 @@
   update_panels();
 }
 
-//  scr_BufferPurge()
+//  scr_BufferPurge(closebuf)
 // Purge/Drop the current buddy buffer
-void scr_BufferPurge(void)
+// If closebuf is 1, close the buffer.
+void scr_BufferPurge(int closebuf)
 {
   winbuf *win_entry;
   guint isspe;
@@ -1776,6 +1777,11 @@
   win_entry->cleared = FALSE;
   win_entry->top = NULL;
 
+  if (closebuf && !isspe) {
+    scr_set_chatmode(FALSE);
+    g_hash_table_remove(winbufhash, CURRENT_JID);
+  }
+
   // Refresh the window
   scr_UpdateBuddyWindow();