diff options
Diffstat (limited to 'src/modes/umode_o.cpp')
-rw-r--r-- | src/modes/umode_o.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/modes/umode_o.cpp b/src/modes/umode_o.cpp index a5f590ba0..9d50e571b 100644 --- a/src/modes/umode_o.cpp +++ b/src/modes/umode_o.cpp @@ -19,10 +19,7 @@ #include "inspircd.h" -#include "mode.h" -#include "channels.h" -#include "users.h" -#include "modes/umode_o.h" +#include "builtinmodes.h" ModeUserOperator::ModeUserOperator() : ModeHandler(NULL, "oper", 'o', PARAM_NONE, MODETYPE_USER) { @@ -32,7 +29,7 @@ ModeUserOperator::ModeUserOperator() : ModeHandler(NULL, "oper", 'o', PARAM_NONE ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding) { /* Only opers can execute this class at all */ - if (!ServerInstance->ULine(source->server) && !IS_OPER(source)) + if (!source->server->IsULine() && !source->IsOper()) return MODEACTION_DENY; /* Not even opers can GIVE the +o mode, only take it away */ @@ -40,14 +37,13 @@ ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, st return MODEACTION_DENY; /* Set the bitfields. - * Note that oper status is only given in cmd_oper.cpp + * Note that oper status is only given in User::Oper() * NOT here. It is impossible to directly set +o without * verifying as an oper and getting an opertype assigned * to your User! */ char snomask = IS_LOCAL(dest) ? 'o' : 'O'; - ServerInstance->SNO->WriteToSnoMask(snomask, "User %s de-opered (by %s)", dest->nick.c_str(), - source->nick.empty() ? source->server.c_str() : source->nick.c_str()); + ServerInstance->SNO->WriteToSnoMask(snomask, "User %s de-opered (by %s)", dest->nick.c_str(), source->nick.c_str()); dest->UnOper(); return MODEACTION_ALLOW; |