1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

irc: fix bug with prefix chars which are in chanmodes with a type different from "B" (bug #36996)

This commit is contained in:
Sebastien Helleu
2012-07-30 14:33:36 +02:00
parent 3f973f8cbc
commit 048b05cb29
2 changed files with 11 additions and 5 deletions
+8 -4
View File
@@ -58,6 +58,14 @@ irc_mode_get_chanmode_type (struct t_irc_server *server, char chanmode)
char chanmode_type, *pos;
const char *chanmodes, *ptr_chanmodes;
/*
* assume it is type 'B' if mode is in prefix
* (we first check that because some exotic servers like irc.webchat.org
* include the prefix chars in chanmodes as type 'A', which is wrong)
*/
if (irc_server_get_prefix_mode_index (server, chanmode) >= 0)
return 'B';
chanmodes = irc_server_get_chanmodes (server);
pos = strchr (chanmodes, chanmode);
if (pos)
@@ -75,10 +83,6 @@ irc_mode_get_chanmode_type (struct t_irc_server *server, char chanmode)
return chanmode_type;
}
/* assume it is type 'B' if mode is not in chanmodes but in prefix */
if (irc_server_get_prefix_mode_index (server, chanmode) >= 0)
return 'B';
/* unknown mode, type 'D' by default */
return 'D';
}