mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 10:13:12 +02:00
Fixed parsing of command "353" when prefixes were not received from server
This commit is contained in:
+9
-3
@@ -298,9 +298,15 @@ irc_mode_user_set (t_irc_server *server, char *modes)
|
||||
int
|
||||
irc_mode_nick_prefix_allowed (t_irc_server *server, char prefix)
|
||||
{
|
||||
/* if server did not send any prefix info, then consider this prefix is allowed */
|
||||
char str[2];
|
||||
|
||||
/* if server did not send any prefix info, then use default prefixes */
|
||||
if (!server->prefix)
|
||||
return 1;
|
||||
|
||||
{
|
||||
str[0] = prefix;
|
||||
str[1] = '\0';
|
||||
return (strpbrk (str, IRC_DEFAULT_PREFIXES_LIST)) ? 1 : 0;
|
||||
}
|
||||
|
||||
return (strchr (server->prefix, prefix) != NULL);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#define PREFIX_SEND_MOD "<=="
|
||||
|
||||
#define IRC_DEFAULT_PORT 6667
|
||||
#define IRC_DEFAULT_PREFIXES_LIST "@%+~&!-"
|
||||
|
||||
/* nick types */
|
||||
|
||||
|
||||
@@ -298,9 +298,15 @@ irc_mode_user_set (t_irc_server *server, char *modes)
|
||||
int
|
||||
irc_mode_nick_prefix_allowed (t_irc_server *server, char prefix)
|
||||
{
|
||||
/* if server did not send any prefix info, then consider this prefix is allowed */
|
||||
char str[2];
|
||||
|
||||
/* if server did not send any prefix info, then use default prefixes */
|
||||
if (!server->prefix)
|
||||
return 1;
|
||||
|
||||
{
|
||||
str[0] = prefix;
|
||||
str[1] = '\0';
|
||||
return (strpbrk (str, IRC_DEFAULT_PREFIXES_LIST)) ? 1 : 0;
|
||||
}
|
||||
|
||||
return (strchr (server->prefix, prefix) != NULL);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#define PREFIX_SEND_MOD "<=="
|
||||
|
||||
#define IRC_DEFAULT_PORT 6667
|
||||
#define IRC_DEFAULT_PREFIXES_LIST "@%+~&!-"
|
||||
|
||||
/* nick types */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user