summaryrefslogtreecommitdiff
path: root/src/modes/cmode_o.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/cmode_o.cpp')
-rw-r--r--src/modes/cmode_o.cpp77
1 files changed, 1 insertions, 76 deletions
diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp
index 9da9fa478..19c365ad9 100644
--- a/src/modes/cmode_o.cpp
+++ b/src/modes/cmode_o.cpp
@@ -72,80 +72,5 @@ void ModeChannelOp::RemoveMode(User*, irc::modestacker* stack)
ModeAction ModeChannelOp::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
- int status = channel->GetPrefixValue(source);
-
- /* Call the correct method depending on wether we're adding or removing the mode */
- if (adding)
- {
- parameter = this->AddOp(source, parameter.c_str(), channel, status);
- }
- else
- {
- parameter = this->DelOp(source, parameter.c_str(), channel, status);
- }
- /* If the method above 'ate' the parameter by reducing it to an empty string, then
- * it won't matter wether we return ALLOW or DENY here, as an empty string overrides
- * the return value and is always MODEACTION_DENY if the mode is supposed to have
- * a parameter.
- */
- if (parameter.length())
- return MODEACTION_ALLOW;
- else
- return MODEACTION_DENY;
-}
-
-std::string ModeChannelOp::AddOp(User *user,const char* dest,Channel *chan,int status)
-{
- User *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status);
-
- if (d)
- {
- if (IS_LOCAL(user))
- {
- ModResult MOD_RESULT;
- FIRST_MOD_RESULT(ServerInstance, OnAccessCheck, MOD_RESULT, (user,d,chan,AC_OP));
-
- if (MOD_RESULT == MOD_RES_DENY)
- return "";
- if (MOD_RESULT == MOD_RES_PASSTHRU)
- {
- if ((status < OP_VALUE) && (!ServerInstance->ULine(user->server)))
- {
- user->WriteServ("482 %s %s :You're not a channel operator",user->nick.c_str(), chan->name.c_str());
- return "";
- }
- }
- }
-
- return d->nick;
- }
- return "";
-}
-
-std::string ModeChannelOp::DelOp(User *user,const char *dest,Channel *chan,int status)
-{
- User *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status);
-
- if (d)
- {
- if (IS_LOCAL(user))
- {
- ModResult MOD_RESULT;
- FIRST_MOD_RESULT(ServerInstance, OnAccessCheck, MOD_RESULT, (user,d,chan,AC_DEOP));
-
- if (MOD_RESULT == MOD_RES_DENY)
- return "";
- if (MOD_RESULT == MOD_RES_PASSTHRU)
- {
- if ((status < OP_VALUE) && (!ServerInstance->ULine(user->server)) && (IS_LOCAL(user)))
- {
- user->WriteServ("482 %s %s :You are not a channel operator",user->nick.c_str(), chan->name.c_str());
- return "";
- }
- }
- }
-
- return d->nick;
- }
- return "";
+ return MODEACTION_ALLOW;
}