summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-11 20:04:15 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-11 20:04:15 +0000
commit153e95f728843541c317df1f0f265059b613e340 (patch)
tree78a563302d6dd5536ba30ef605d5039a9bedf32d /src
parent524a7ca1b970a7e16c032fdc0dec179b68a8c1d8 (diff)
downloadirssi-153e95f728843541c317df1f0f265059b613e340.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/window-items.c10
1 files changed, 10 insertions, 0 deletions
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)