diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-03-10 22:44:21 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-03-10 22:44:21 +0000 |
commit | 4181fa3f7419e08405409768ef68d5bcc607e246 (patch) | |
tree | e4d3868536441531988949a8bb35c894e14bd27e /src | |
parent | b9e247794e5b9768f5e8c2dabd9845d7dbe0ed56 (diff) | |
download | weechat-4181fa3f7419e08405409768ef68d5bcc607e246.zip |
Fixed /mode command output
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/irc-recv.c | 81 |
1 files changed, 80 insertions, 1 deletions
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c index 51972ca37..20cf5517b 100644 --- a/src/irc/irc-recv.c +++ b/src/irc/irc-recv.c @@ -604,7 +604,7 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel, char *channel_name, char *nick_host, char *modes, char *parm) { - char *pos, set_flag; + char *pos, set_flag, unknown_mode[3]; t_irc_nick *ptr_nick; set_flag = '+'; @@ -643,6 +643,31 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel, parm = pos; } break; + case 'd': + pos = NULL; + if (parm) + { + pos = strchr (parm, ' '); + if (pos) + pos[0] = '\0'; + } + if (nick_host) + irc_display_mode (server, ptr_channel->buffer, + channel_name, set_flag, "d", nick_host, + (set_flag == '+') ? + _("sets realname ban on") : + _("removes realname ban on"), + (parm) ? parm : NULL); + + /* look for next parameter */ + if (parm && pos) + { + pos++; + while (pos[0] == ' ') + pos++; + parm = pos; + } + break; case 'e': pos = NULL; if (parm) @@ -739,6 +764,31 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel, CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'), CHANNEL_MODE_INVITE); break; + case 'I': + pos = NULL; + if (parm) + { + pos = strchr (parm, ' '); + if (pos) + pos[0] = '\0'; + } + if (nick_host) + irc_display_mode (server, ptr_channel->buffer, + channel_name, set_flag, "I", nick_host, + (set_flag == '+') ? + _("blocks invite on") : + _("removes invite block on"), + (parm) ? parm : NULL); + + /* look for next parameter */ + if (parm && pos) + { + pos++; + while (pos[0] == ' ') + pos++; + parm = pos; + } + break; case 'k': pos = NULL; if (parm) @@ -952,6 +1002,35 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel, parm = pos; } break; + default: /* unknown mode received */ + pos = NULL; + if (parm) + { + pos = strchr (parm, ' '); + if (pos) + pos[0] = '\0'; + } + if (nick_host) + { + unknown_mode[0] = set_flag; + unknown_mode[1] = modes[0]; + unknown_mode[2] = '\0'; + irc_display_mode (server, ptr_channel->buffer, + channel_name, set_flag, unknown_mode + 1, + nick_host, + unknown_mode, + (parm) ? parm : NULL); + } + + /* look for next parameter */ + if (parm && pos) + { + pos++; + while (pos[0] == ' ') + pos++; + parm = pos; + } + break; } modes++; } |