summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-12-29 00:11:24 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-12-29 00:11:24 +0000
commit84d672ee42778f4c92f577bfdf89c48d77ce3656 (patch)
tree861a0aa85a76227a79eaca1382cb9f193eb1d0d8 /src
parentb6075cf36c8e0512910280158dea3b1aba212326 (diff)
downloadirssi-84d672ee42778f4c92f577bfdf89c48d77ce3656.zip
If msg comes from unknown channel (like when you just closed some
channel window and server sends the last msg to the channel) irssi now prints the msg to active window instead of sending glib warning. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1026 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/fe-messages.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c
index fa431939..86417c64 100644
--- a/src/fe-common/core/fe-messages.c
+++ b/src/fe-common/core/fe-messages.c
@@ -123,14 +123,16 @@ static void sig_message_public(SERVER_REC *server, const char *msg,
int for_me, print_channel, level;
char *color, *freemsg;
+ /* NOTE: this may return NULL if some channel is just closed with
+ /WINDOW CLOSE and server still sends the few last messages */
chanrec = channel_find(server, target);
- g_return_if_fail(chanrec != NULL);
for_me = nick_match_msg(chanrec, msg, server->nick);
color = for_me ? NULL :
hilight_find_nick(target, nick, address, MSGLEVEL_PUBLIC, msg);
- print_channel = !window_item_is_active((WI_ITEM_REC *) chanrec);
+ print_channel = chanrec == NULL ||
+ !window_item_is_active((WI_ITEM_REC *) chanrec);
if (!print_channel && settings_get_bool("print_active_channel") &&
window_item_window((WI_ITEM_REC *) chanrec)->items->next != NULL)
print_channel = TRUE;