summaryrefslogtreecommitdiff
path: root/src/modes/umode_s.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/umode_s.cpp')
-rw-r--r--src/modes/umode_s.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp
index a56e29034..0c005f56a 100644
--- a/src/modes/umode_s.cpp
+++ b/src/modes/umode_s.cpp
@@ -12,14 +12,15 @@ ModeAction ModeUserServerNotice::OnModeChange(userrec* source, userrec* dest, ch
{
/* Only opers can change other users modes */
if ((source != dest) && (!*source->oper))
- return MODEACTION_ALLOW;
+ return MODEACTION_DENY;
/* Set the bitfields */
- adding ? dest->modebits |= UM_SERVERNOTICE : dest->modebits &= ~UM_SERVERNOTICE;
-
- /* Use the bitfields to build the user's mode string */
- ModeParser::BuildModeString(dest);
+ if (dest->modes[UM_SERVERNOTICE] != adding)
+ {
+ dest->modes[UM_SERVERNOTICE] = adding;
+ return MODEACTION_ALLOW;
+ }
/* Allow the change */
- return MODEACTION_ALLOW;
+ return MODEACTION_DENY;
}