Permalink
Browse files

Checks bans when received through botnet with users on chans. Fixes #10

14 years later... When a ban is shared through the botnet, bots now immediately check all shared channels they are on for offending users (ie, if the bot creating the global ban isn't physically on a shared channel the user is on, the local bot on the shared channel will enforce).
  • Loading branch information...
Cizzle authored and vanosg committed Sep 19, 2017
1 parent bff20de commit 45f8638a27bb68c5a59393bc2efe6e9b244a7072
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/mod/share.mod/share.c
View
@@ -819,6 +819,8 @@ static void share_pls_ban(int idx, char *par)
time_t expire_time;
char *ban, *tm, *from;
int flags = 0;
module_entry *me;
struct chanset_t *chan = NULL;
if (dcc[idx].status & STAT_SHARE) {
shareout_but(NULL, idx, "+b %s\n", par);
@@ -838,6 +840,11 @@ static void share_pls_ban(int idx, char *par)
u_addban(NULL, ban, from, par, expire_time, flags);
putlog(LOG_CMDS, "*", "%s: global ban %s (%s:%s)", dcc[idx].nick, ban,
from, par);
/* check ban against users in chans */
if ((me = module_find("irc", 0, 0)))
for (chan = chanset; chan != NULL; chan = chan->next)
if (channel_shared(chan))
(me->funcs[IRC_CHECK_THIS_BAN]) (chan, ban, flags & MASKREC_STICKY);
noshare = 0;
}
}
@@ -848,6 +855,7 @@ static void share_pls_banchan(int idx, char *par)
int flags = 0;
struct chanset_t *chan;
char *ban, *tm, *chname, *from;
module_entry *me;
if (dcc[idx].status & STAT_SHARE) {
ban = newsplit(&par);
@@ -876,6 +884,9 @@ static void share_pls_banchan(int idx, char *par)
if (expire_time != 0L)
expire_time += now;
u_addban(chan, ban, from, par, expire_time, flags);
/* check ban against users in chan */
if ((me = module_find("irc", 0, 0)))
(me->funcs[IRC_CHECK_THIS_BAN]) (chan, ban, flags & MASKREC_STICKY);
noshare = 0;
}
}

0 comments on commit 45f8638

Please sign in to comment.