diff options
Diffstat (limited to 'src/plugins/irc/irc-channel.c')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 92f741de7..fd97c3fa5 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -667,19 +667,23 @@ int irc_channel_is_channel (struct t_irc_server *server, const char *string) { char first_char[2]; + const char *ptr_chantypes; if (!string) return 0; first_char[0] = string[0]; first_char[1] = '\0'; - return strpbrk( - first_char, - (server ? - (server->chantypes ? - server->chantypes : - IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_DEFAULT_CHANTYPES)) - : irc_channel_default_chantypes)) ? 1 : 0; + + /* default global chantypes if no server received */ + if (!server) + return (strpbrk (first_char, irc_channel_default_chantypes)) ? 1 : 0; + + /* server chantypes, or option "default_chantypes" as fallback */ + ptr_chantypes = (server->chantypes) ? + server->chantypes : + IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_DEFAULT_CHANTYPES); + return (strpbrk (first_char, ptr_chantypes)) ? 1 : 0; } /* |