summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-01-16 20:11:15 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2005-01-16 20:11:15 +0000
commit26bd7c0418651493c50040c769e7f94b13097283 (patch)
tree7cfa41a9656dd727729a4f19a9833ebe0bdd6cd0 /src
parent4bf0358e8ff03a9b9a31639a3d057f0d679c2f7d (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/channels.c19
1 files changed, 15 insertions, 4 deletions
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;
}
}