From 26bd7c0418651493c50040c769e7f94b13097283 Mon Sep 17 00:00:00 2001 From: "trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sun, 16 Jan 2005 20:11:15 +0000 Subject: BUILD : 1.7.7 (542) BUGS : 263 NOTES : BotServ bots would flood if they were attempting to reset modes on themselves ie.. (-oooooo), this fix makes them check if they set the mode last on themselves, if so it ignores and continues. This should also fix if you did -v to a bot as it would says non-existant user git-svn-id: svn://svn.anope.org/anope/trunk@542 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@395 5417fbe8-f217-4b02-8779-1006273d7864 --- src/channels.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/channels.c b/src/channels.c index 5fd2340d1..240f308a0 100644 --- a/src/channels.c +++ b/src/channels.c @@ -180,6 +180,9 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av, CBMode *cbm; CMMode *cmm; CUMode *cum; + int botcheck = 0; + unsigned char botmode; + BotInfo *bi; if (debug) alog("debug: Changing modes for %s to %s", chan->name, @@ -215,11 +218,19 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av, av++; if ((cum->flags & CUF_PROTECT_BOTSERV) && !add) { - BotInfo *bi; - if ((bi = findbot(*av))) { - anope_cmd_mode(bi->nick, chan->name, "+%c %s", mode, - bi->nick); + if (!botmode || botmode != mode) { + anope_cmd_mode(bi->nick, chan->name, "+%c %s", + mode, bi->nick); + botmode = mode; + continue; + } else { + botmode = mode; + continue; + } + } + } else { + if ((bi = findbot(*av))) { continue; } } -- cgit