summaryrefslogtreecommitdiff
path: root/src/channels.c
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-11-07 03:36:30 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-11-07 03:36:30 +0000
commitc58d37f49dfc674920ae2ccd93d6fd32df68544d (patch)
treecc978d68faceecbac0b087cd2a6e8218ca23643d /src/channels.c
parentb4489cffedcc217d72403f00c3087e446e4b7348 (diff)
BUILD : 1.7.6 (439) BUGS : 68, 170, 209 NOTES : 1. DrSteins XOP patch (bug# 170), 2. Cleaned up the English language file for grammar (bug# 209), 3. Patch that fixes segfaults under NetBSD, 4. Cleaned up some places that could lead to segfaults, 5. DrSteins patch for NS ACCESS LIST, 6. Chanserv taking modes more than once (bug #68), 7. Fixed errors when doing "make" under some BSD systems, 8. Fixed syntax error when NSForceEmail is disabled
git-svn-id: svn://svn.anope.org/anope/trunk@439 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@294 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/channels.c')
-rw-r--r--src/channels.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/channels.c b/src/channels.c
index 94cc880f8..eff7b5f96 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -235,10 +235,32 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
mode, chan->name, user->nick);
if (add) {
- if (check && cum->is_valid
- && !cum->is_valid(user, chan, servermode))
- continue;
- chan_set_user_status(chan, user, cum->status);
+ /* Fixes bug #68
+ - might be a bit ugly but it works, the idea is that since the
+ is_valid function strips out all of the modes there is no point
+ in sending it over and over again
+ */
+ if (check) {
+ if (check == 2 && cum->is_valid) {
+ if (debug) {
+ alog("debug: Modes already removed, calling remove_user_status() to clean up");
+ }
+ chan_remove_user_status(chan, user, cum->status);
+ continue;
+ } else if (cum->is_valid
+ && !cum->is_valid(user, chan, servermode)) {
+ if (debug) {
+ alog("debug: Modes already sent calling remove_user_status() to clean up");
+ }
+ chan_remove_user_status(chan, user, cum->status);
+ check = 2;
+ continue;
+ } else {
+ chan_set_user_status(chan, user, cum->status);
+ }
+ } else {
+ chan_set_user_status(chan, user, cum->status);
+ }
} else {
chan_remove_user_status(chan, user, cum->status);
}