diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-04 17:28:26 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-04 17:28:26 +0000 |
commit | d844880515cca4f0f3984b3d9de71c0b168b647b (patch) | |
tree | 08919043ca016131fe1e844b3b614df19d61018c /src/irc | |
parent | f3f80c14991779433c9a1eb13554d846a33205c6 (diff) | |
download | irssi-d844880515cca4f0f3984b3d9de71c0b168b647b.zip |
/UNBAN <ref#> works. /BAN list shows reference numbers.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1062 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/bans.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/irc/core/bans.c b/src/irc/core/bans.c index 947f3d69..5cd6a6e1 100644 --- a/src/irc/core/bans.c +++ b/src/irc/core/bans.c @@ -176,7 +176,8 @@ void ban_remove(IRC_CHANNEL_REC *channel, const char *bans) g_string_free(str, TRUE); } -static void command_set_ban(const char *data, IRC_SERVER_REC *server, void *item, int set) +static void command_set_ban(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item, int set) { IRC_CHANNEL_REC *chanrec; char *channel, *nicks; @@ -204,8 +205,17 @@ static void command_set_ban(const char *data, IRC_SERVER_REC *server, void *item if (set) ban_set(chanrec, nicks); - else + else { + if (is_numeric(nicks, '\0')) { + /* unban with ban number */ + BAN_REC *ban = g_slist_nth_data(chanrec->banlist, + atoi(nicks)-1); + if (ban != NULL) + nicks = ban->ban; + } + ban_remove(chanrec, nicks); + } cmd_params_free(free_arg); } |