# HG changeset patch # User Mikael Berthe # Date 1194633165 -3600 # Node ID 8e4e741787be11756360aa1f89ba850ae2740365 # Parent 44ff580ee38808ed494a90d8a4a751fdbdffab2c Small change to buffer close Don't leave chat mode if the buffer to close isn't the current one. diff -r 44ff580ee388 -r 8e4e741787be mcabber/src/screen.c --- a/mcabber/src/screen.c Thu Nov 08 23:46:18 2007 +0100 +++ b/mcabber/src/screen.c Fri Nov 09 19:32:45 2007 +0100 @@ -2397,10 +2397,18 @@ guint isspe; guint *p_closebuf; const char *cjid; + guint hold_chatmode = FALSE; if (jid) { cjid = jid; isspe = FALSE; + // If closebuf is TRUE, it's probably better not to leave chat mode + // if the change isn't related to the current buffer. + if (closebuf && current_buddy) { + if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_SPECIAL || + strcasecmp(jid, CURRENT_JID)) + hold_chatmode = TRUE; + } } else { // Get win_entry if (!current_buddy) return; @@ -2415,7 +2423,7 @@ *p_closebuf = closebuf; buffer_purge((gpointer)cjid, win_entry, p_closebuf); g_free(p_closebuf); - if (closebuf) { + if (closebuf && !hold_chatmode) { scr_set_chatmode(FALSE); currentWindow = NULL; }