summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/actions.c b/src/actions.c
index a863eae76..1cfcdf2e1 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -113,12 +113,16 @@ void common_unban(ChannelInfo * ci, char *nick)
int count, i;
char *av[3], **bans;
User *u;
+ char *host;
- if (!ci || !ci->c || !ci->bi || !nick)
+ if (!ci || !ci->c || !nick)
return;
+
if (!(u = finduser(nick)))
return;
+ host = host_resolve(u->host);
+
if (ircd->svsmode_unban) {
anope_cmd_unban(ci->name, nick);
} else {
@@ -131,7 +135,15 @@ void common_unban(ChannelInfo * ci, char *nick)
if (match_usermask(bans[i], u)) {
anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]);
av[2] = bans[i];
- do_cmode(ci->bi->nick, 3, av);
+ do_cmode(whosends(ci), 3, av);
+ }
+ if (host) {
+ if (match_userip(bans[i], u, host)) {
+ anope_cmd_mode(whosends(ci), ci->name, "-b %s",
+ bans[i]);
+ av[2] = bans[i];
+ do_cmode(whosends(ci), 3, av);
+ }
}
}
free(bans);