summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-08-14 14:42:10 +0000
committerSebastien Helleu <flashcode@flashtux.org>2007-08-14 14:42:10 +0000
commit0c8867c9e3aa41c37c4dbb9045b8b6bf3cfa746b (patch)
tree2f0dea378a07fc80e162db87a9f27471e2f4e681 /src
parent57ceaba3d1f21408599c2bbe83697caf0951d4f6 (diff)
downloadweechat-0c8867c9e3aa41c37c4dbb9045b8b6bf3cfa746b.zip
Fixed parsing of command "353" when prefixes were not received from server
Diffstat (limited to 'src')
-rw-r--r--src/irc/irc-mode.c12
-rw-r--r--src/irc/irc.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/irc/irc-mode.c b/src/irc/irc-mode.c
index cc1cd243c..ba76c7dfc 100644
--- a/src/irc/irc-mode.c
+++ b/src/irc/irc-mode.c
@@ -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);
}
diff --git a/src/irc/irc.h b/src/irc/irc.h
index a52d446a6..570a254ca 100644
--- a/src/irc/irc.h
+++ b/src/irc/irc.h
@@ -53,6 +53,7 @@
#define PREFIX_SEND_MOD "<=="
#define IRC_DEFAULT_PORT 6667
+#define IRC_DEFAULT_PREFIXES_LIST "@%+~&!-"
/* nick types */