diff options
author | Timo Sirainen <cras@irssi.org> | 2003-12-10 23:04:00 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2003-12-10 23:04:00 +0000 |
commit | 77f43fe1fba18a8a627d5e565e53fa619f454277 (patch) | |
tree | 07f38e70f8b6a2fffcf09f08b923f1c88ccedd6f /src | |
parent | 5bbeffbcbd3b6a90340ae3f0fb02c6a88fe8fbf5 (diff) | |
download | irssi-77f43fe1fba18a8a627d5e565e53fa619f454277.zip |
Window layout restoring queries didn't check if the chat protocol was yet
loaded and crashed. Patch by c0ffee
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3194 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/windows-layout.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/fe-common/core/windows-layout.c b/src/fe-common/core/windows-layout.c index 9429c00a..223b6524 100644 --- a/src/fe-common/core/windows-layout.c +++ b/src/fe-common/core/windows-layout.c @@ -61,12 +61,25 @@ static void sig_layout_restore_item(WINDOW_REC *window, const char *type, WINDOW_BIND_REC *rec = window_bind_add(window, tag, name); rec->sticky = TRUE; } else if (g_strcasecmp(type, "QUERY") == 0 && chat_type != NULL) { + CHAT_PROTOCOL_REC *protocol; /* create query immediately */ signal_add("query created", (SIGNAL_FUNC) signal_query_created_curwin); restore_win = window; - chat_protocol_find(chat_type)->query_create(tag, name, TRUE); + + protocol = chat_protocol_find(chat_type); + if (protocol->query_create != NULL) + protocol->query_create(tag, name, TRUE); + else { + QUERY_REC *query; + + query = g_new0(QUERY_REC, 1); + query->chat_type = chat_protocol_lookup(chat_type); + query->name = g_strdup(name); + query->server_tag = g_strdup(tag); + query_init(query, TRUE); + } signal_remove("query created", (SIGNAL_FUNC) signal_query_created_curwin); |