summaryrefslogtreecommitdiff
path: root/src/modes/umode_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/umode_i.cpp')
-rw-r--r--src/modes/umode_i.cpp13
1 files changed, 7 insertions, 6 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;
}