1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

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
This commit is contained in:
Timo Sirainen 2003-12-10 23:04:00 +00:00 committed by cras
parent 5bbeffbcbd
commit 77f43fe1fb

View File

@ -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); WINDOW_BIND_REC *rec = window_bind_add(window, tag, name);
rec->sticky = TRUE; rec->sticky = TRUE;
} else if (g_strcasecmp(type, "QUERY") == 0 && chat_type != NULL) { } else if (g_strcasecmp(type, "QUERY") == 0 && chat_type != NULL) {
CHAT_PROTOCOL_REC *protocol;
/* create query immediately */ /* create query immediately */
signal_add("query created", signal_add("query created",
(SIGNAL_FUNC) signal_query_created_curwin); (SIGNAL_FUNC) signal_query_created_curwin);
restore_win = window; 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_remove("query created",
(SIGNAL_FUNC) signal_query_created_curwin); (SIGNAL_FUNC) signal_query_created_curwin);