Created
January 3, 2015 13:48
-
-
Save foxlet/177f9e07989e14edddb7 to your computer and use it in GitHub Desktop.
modules/commands/cs_entrymsg.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override | |
{ | |
ChannelInfo *ci = ChannelInfo::Find(params[0]); | |
if (ci == NULL) | |
{ | |
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str()); | |
return; | |
} | |
if (Anope::ReadOnly && !params[1].equals_ci("LIST")) | |
{ | |
source.Reply(READ_ONLY_MODE); | |
return; | |
} | |
bool has_access = false; | |
if (source.HasPriv("chanserv/access/modify")) | |
has_access = true; | |
else if (source.AccessFor(ci).HasPriv("ACCESS_CHANGE")) | |
has_access = true; | |
if (!has_access) | |
{ | |
source.Reply(ACCESS_DENIED); | |
return; | |
} | |
if (params[1].equals_ci("LIST")) | |
this->DoList(source, ci); | |
else if (params[1].equals_ci("CLEAR")) | |
this->DoClear(source, ci); | |
else if (params.size() < 3) | |
this->OnSyntaxError(source, ""); | |
else if (params[1].equals_ci("ADD")) | |
this->DoAdd(source, ci, params[2]); | |
else if (params[1].equals_ci("DEL")) | |
this->DoDel(source, ci, params[2]); | |
else | |
this->OnSyntaxError(source, ""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment