From c5016e390ff6bb4e3aa65db0b446d9cbac42994b Mon Sep 17 00:00:00 2001 From: TingPing Date: Wed, 31 Dec 2014 10:50:13 -0500 Subject: [PATCH] Show correct number of channels/dialogs when closing server tab --- src/fe-gtk/maingui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 2eabe8b7..a5472b70 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -1096,8 +1096,11 @@ mg_tab_close (session *sess) else { for (i = 0, list = sess_list; list; list = list->next) - if (((session *)list->data)->server == sess->server) + { + session *s = (session*)list->data; + if (s->server == sess->server && (s->type == SESS_CHANNEL || s->type == SESS_DIALOG)) i++; + } dialog = gtk_message_dialog_new (GTK_WINDOW (parent_window), 0, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK_CANCEL, _("This server still has %d channels or dialogs associated with it. "