summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/umode_i.cpp13
-rw-r--r--src/modes/umode_s.cpp13
-rw-r--r--src/modes/umode_w.cpp13
3 files changed, 21 insertions, 18 deletions
diff --git a/src/modes/umode_i.cpp b/src/modes/umode_i.cpp
index 08af105ca..584a12ff5 100644
--- a/src/modes/umode_i.cpp
+++ b/src/modes/umode_i.cpp
@@ -12,14 +12,15 @@ ModeAction ModeUserInvisible::OnModeChange(userrec* source, userrec* dest, chanr
{
/* 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_INVISIBLE : dest->modebits &= ~UM_INVISIBLE;
-
- /* Use the bitfields to build the user's mode string */
- ModeParser::BuildModeString(dest);
+ if (dest->modes[UM_INVISIBLE] != adding)
+ {
+ dest->modes[UM_INVISIBLE] = adding;
+ return MODEACTION_ALLOW;
+ }
/* Allow the change */
- return MODEACTION_ALLOW;
+ return MODEACTION_DENY;
}
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;
}
diff --git a/src/modes/umode_w.cpp b/src/modes/umode_w.cpp
index 9115a6786..8cfbf8fd2 100644
--- a/src/modes/umode_w.cpp
+++ b/src/modes/umode_w.cpp
@@ -12,14 +12,15 @@ ModeAction ModeUserWallops::OnModeChange(userrec* source, userrec* dest, chanrec
{
/* 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_WALLOPS : dest->modebits &= ~UM_WALLOPS;
-
- /* Use the bitfields to build the user's mode string */
- ModeParser::BuildModeString(dest);
+ if (dest->modes[UM_WALLOPS] != adding)
+ {
+ dest->modes[UM_WALLOPS] = adding;
+ return MODEACTION_ALLOW;
+ }
/* Allow the change */
- return MODEACTION_ALLOW;
+ return MODEACTION_DENY;
}