summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-04-08 23:36:14 -0500
committerAdam <Adam@anope.org>2013-04-08 23:37:42 -0500
commit0a3d27a91f826db7c3bb639901450a5b00c80b64 (patch)
treec1045d56cd43ff6775221c897ab28e27faa56ad3 /src
parentbcd85ca68281b8f10d4357d6f7daeced4b79a9b4 (diff)
Made XOP privileges configurable
Diffstat (limited to 'src')
-rw-r--r--src/access.cpp47
-rw-r--r--src/command.cpp4
2 files changed, 49 insertions, 2 deletions
diff --git a/src/access.cpp b/src/access.cpp
index 7a178b446..6f9a8cd8f 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -16,8 +16,55 @@
#include "users.h"
#include "account.h"
+static struct
+{
+ Anope::string name;
+ Anope::string desc;
+} descriptions[] = {
+ {"ACCESS_CHANGE", _("Allowed to modify the access list")},
+ {"ACCESS_LIST", _("Allowed to view the access list")},
+ {"AKICK", _("Allowed to use the AKICK command")},
+ {"ASSIGN", _("Allowed to assign/unassign a bot")},
+ {"AUTOHALFOP", _("Automatic halfop upon join")},
+ {"AUTOOP", _("Automatic channel operator status upon join")},
+ {"AUTOOWNER", _("Automatic owner upon join")},
+ {"AUTOPROTECT", _("Automatic protect upon join")},
+ {"AUTOVOICE", _("Automatic voice on join")},
+ {"BADWORDS", _("Allowed to modify channel badwords list")},
+ {"BAN", _("Allowed to ban users")},
+ {"FANTASIA", _("Allowed to use fantasy commands")},
+ {"FOUNDER", _("Allowed to issue commands restricted to channel founders")},
+ {"GETKEY", _("Allowed to use GETKEY command")},
+ {"GREET", _("Greet message displayed on join")},
+ {"HALFOP", _("Allowed to (de)halfop users")},
+ {"HALFOPME", _("Allowed to (de)halfop him/herself")},
+ {"INFO", _("Allowed to get full INFO output")},
+ {"INVITE", _("Allowed to use the INVITE command")},
+ {"KICK", _("Allowed to use the KICK command")},
+ {"MEMO", _("Allowed to read channel memos")},
+ {"MODE", _("Allowed to use the MODE command")},
+ {"NOKICK", _("Prevents users being kicked by Services")},
+ {"OPDEOP", _("Allowed to (de)op users")},
+ {"OPDEOPME", _("Allowed to (de)op him/herself")},
+ {"OWNER", _("Allowed to (de)owner users")},
+ {"OWNERME", _("Allowed to (de)owner him/herself")},
+ {"PROTECT", _("Allowed to (de)protect users")},
+ {"PROTECTME", _("Allowed to (de)protect him/herself")},
+ {"SAY", _("Allowed to use SAY and ACT commands")},
+ {"SET", _("Allowed to set channel settings")},
+ {"SIGNKICK", _("No signed kick when SIGNKICK LEVEL is used")},
+ {"TOPIC", _("Allowed to change channel topics")},
+ {"UNBAN", _("Allowed to unban users")},
+ {"VOICE", _("Allowed to (de)voice users")},
+ {"VOICEME", _("Allowed to (de)voice him/herself")}
+};
+
Privilege::Privilege(const Anope::string &n, const Anope::string &d, int r) : name(n), desc(d), rank(r)
{
+ if (this->desc.empty())
+ for (unsigned j = 0; j < sizeof(descriptions) / sizeof(*descriptions); ++j)
+ if (descriptions[j].name == name)
+ this->desc = descriptions[j].desc;
}
bool Privilege::operator==(const Privilege &other) const
diff --git a/src/command.cpp b/src/command.cpp
index db30a25f3..9d058fefb 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -178,14 +178,14 @@ void Command::RequireUser(bool b)
this->require_user = b;
}
-const Anope::string &Command::GetDesc() const
+const Anope::string Command::GetDesc(CommandSource &) const
{
return this->desc;
}
void Command::OnServHelp(CommandSource &source)
{
- source.Reply(" %-14s %s", source.command.c_str(), Language::Translate(source.nc, this->GetDesc().c_str()));
+ source.Reply(" %-14s %s", source.command.c_str(), Language::Translate(source.nc, this->GetDesc(source).c_str()));
}
bool Command::OnHelp(CommandSource &source, const Anope::string &subcommand) { return false; }