summaryrefslogtreecommitdiff
path: root/src/modes/cmode_h.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/cmode_h.cpp')
-rw-r--r--src/modes/cmode_h.cpp78
1 files changed, 1 insertions, 77 deletions
diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp
index 480d69f0a..a61df4ba0 100644
--- a/src/modes/cmode_h.cpp
+++ b/src/modes/cmode_h.cpp
@@ -74,81 +74,5 @@ void ModeChannelHalfOp::RemoveMode(User*, irc::modestacker* stack)
ModeAction ModeChannelHalfOp::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->AddHalfOp(source, parameter.c_str(), channel, status);
- }
- else
- {
- parameter = this->DelHalfOp(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 ModeChannelHalfOp::AddHalfOp(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_HALFOP));
-
- 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 "";
+ return MODEACTION_ALLOW;
}
-
-std::string ModeChannelHalfOp::DelHalfOp(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_DEHALFOP));
-
- if (MOD_RESULT == MOD_RES_DENY)
- return "";
- if (MOD_RESULT == MOD_RES_PASSTHRU)
- {
- if ((user != d) && ((status < OP_VALUE) && (!ServerInstance->ULine(user->server))))
- {
- user->WriteServ("482 %s %s :You are not a channel operator",user->nick.c_str(), chan->name.c_str());
- return "";
- }
- }
- }
-
- return d->nick;
- }
- return "";
-}
-