From 153e95f728843541c317df1f0f265059b613e340 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 11 Jun 2000 20:04:15 +0000 Subject: [PATCH] Clear window's waiting_channels list if some other channel/query is created in the window. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@323 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/window-items.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fe-common/core/window-items.c b/src/fe-common/core/window-items.c index ba02fd2d..a1a15067 100644 --- a/src/fe-common/core/window-items.c +++ b/src/fe-common/core/window-items.c @@ -218,12 +218,14 @@ void window_item_create(WI_ITEM_REC *item, int automatic) WINDOW_REC *window; GSList *tmp; char *str; + int clear_waiting; g_return_if_fail(item != NULL); str = item->server == NULL ? NULL : g_strdup_printf("%s %s", ((SERVER_REC *) item->server)->tag, item->name); + clear_waiting = TRUE; window = NULL; for (tmp = windows; tmp != NULL; tmp = tmp->next) { WINDOW_REC *rec = tmp->data; @@ -239,6 +241,7 @@ void window_item_create(WI_ITEM_REC *item, int automatic) some waiting list? */ if (waiting_channels_get(rec, str)) { window = rec; + clear_waiting = FALSE; break; } } @@ -252,6 +255,13 @@ void window_item_create(WI_ITEM_REC *item, int automatic) /* use existing window */ window_add_item(window, item, automatic); } + + if (clear_waiting) { + /* clear window's waiting_channels list */ + g_slist_foreach(window->waiting_channels, (GFunc) g_free, NULL), + g_slist_free(window->waiting_channels); + window->waiting_channels = NULL; + } } static void signal_window_item_changed(WINDOW_REC *window, WI_ITEM_REC *item)