summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-02-09 05:27:08 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-02-09 05:27:08 +0000
commitdd198b89c0d6e11c69c5aec9ef2f5118efcd3e9c (patch)
tree9120c4076a849ac69848038420733e0a22c3ebd5 /src
parent2cfcf3c5122b9f874467044bb932778cef90f168 (diff)
Fixed it so halfops can not be marked as forcibly deopped, fixes us sometimes undoing all modes by some halfops
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2787 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/channels.c b/src/channels.c
index 2160df56b..c7b96a860 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -262,9 +262,9 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av,
if (add) {
chan_set_user_status(chan, user, cum->status);
- /* If this does +o, remove any DEOPPED flag */
- if (cum->status & CUS_OP)
- chan_remove_user_status(chan, user, CUS_DEOPPED);
+ /* If this does +o or +h, remove any DEOPPED flag */
+ if (cum->status & CUS_OP || cum->status & CUS_HALFOP)
+ chan_remove_user_status(chan, user, CUS_DEOPPED);
} else {
chan_remove_user_status(chan, user, cum->status);
}
@@ -1512,6 +1512,8 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
strcat(modebuf, "h");
strcat(userbuf, " ");
strcat(userbuf, GET_USER(user));
+ /* Halfops are ops too, having a halfop with CUS_DEOPPED is not good - Adam */
+ rem_modes |= CUS_DEOPPED;
} else {
add_modes &= ~CUS_HALFOP;
}
@@ -1543,12 +1545,17 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
strcat(modebuf, "o");
strcat(userbuf, " ");
strcat(userbuf, GET_USER(user));
- add_modes |= CUS_DEOPPED;
+ /* Do not mark a user as deopped if they are halfopd - Adam */
+ if (!(add_modes & CUS_HALFOP) && !(status & CUS_HALFOP))
+ add_modes |= CUS_DEOPPED;
}
if (rem_modes & CUS_HALFOP) {
strcat(modebuf, "h");
strcat(userbuf, " ");
strcat(userbuf, GET_USER(user));
+ /* Do not mark a user as deopped if they are opped - Adam */
+ if (!(add_modes & CUS_OP) && !(status & CUS_OP))
+ add_modes |= CUS_DEOPPED;
}
}