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:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user