1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 23:36:37 +02:00

irc: use statusmsg from message 005 to check prefix char in status notices/messages

This commit is contained in:
Sebastien Helleu
2014-01-02 10:47:18 +01:00
parent 46e46ed763
commit 5668e2ab12
5 changed files with 65 additions and 45 deletions
+26
View File
@@ -875,6 +875,32 @@ irc_server_get_chanmodes (struct t_irc_server *server)
server->chanmodes : irc_server_chanmodes_default;
}
/*
* Checks if a prefix char is valid for a status message
* (message sent for example to ops/voiced).
*
* The prefix (for example '@' or '+') must be in STATUSMSG,
* or in "prefix_chars" if STATUSMSG is not defined.
*
* Returns:
* 1: prefix is valid for a status message
* 0: prefix is NOT valid for a status message
*/
int
irc_server_prefix_char_statusmsg (struct t_irc_server *server,
char prefix_char)
{
const char *support_statusmsg;
support_statusmsg = irc_server_get_isupport_value (server, "STATUSMSG");
if (support_statusmsg)
return (strchr (support_statusmsg, prefix_char)) ? 1 : 0;
return (irc_server_get_prefix_char_index (server, prefix_char) >= 0) ?
1 : 0;
}
/*
* Allocates a new server and adds it to the servers queue.
*