summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-01-27 08:40:26 -0500
committerAdam <Adam@anope.org>2017-01-27 08:40:26 -0500
commit9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (patch)
tree618a4f0e173166e6f966a7cce78f06c3c1c3299f /include
parent16ca76c2e7ab287e480185fbb03a0bb438351eda (diff)
Store CommandInfo in CommandSource instead of just command/permission
Diffstat (limited to 'include')
-rw-r--r--include/commands.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/commands.h b/include/commands.h
index 5431df7a5..d3aa180a2 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -35,8 +35,6 @@ struct CommandInfo
{
typedef Anope::map<CommandInfo> map;
- CommandInfo() : hide(false), prepend_channel(false) { }
-
/* Service name of the command */
Anope::string name;
/* User visible name */
@@ -46,9 +44,9 @@ struct CommandInfo
/* Group this command is in */
Anope::string group;
/* whether or not to hide this command in help output */
- bool hide;
+ bool hide = false;
/* Only used with fantasy */
- bool prepend_channel;
+ bool prepend_channel = false;
};
/* Where the replies from commands go to. User inheits from this and is the normal
@@ -67,6 +65,8 @@ class CoreExport CommandSource
Anope::string nick;
/* User executing the command, may be NULL */
Reference<User> u;
+ /* Command info being executed */
+ CommandInfo command;
public:
/* The account executing the command */
Reference<NickServ::Account> nc;
@@ -76,10 +76,6 @@ class CoreExport CommandSource
Reference<Channel> c;
/* The service this command is on */
Reference<ServiceBot> service;
- /* The actual name of the command being executed */
- Anope::string command;
- /* The permission of the command being executed */
- Anope::string permission;
CommandSource(const Anope::string &n, User *user, NickServ::Account *core, CommandReply *reply, ServiceBot *bi);
@@ -87,7 +83,14 @@ class CoreExport CommandSource
User *GetUser();
NickServ::Account *GetAccount();
Anope::string GetSource();
+
const Anope::string &GetCommand() const;
+ void SetCommand(const Anope::string &);
+
+ const Anope::string &GetPermission() const;
+
+ const CommandInfo &GetCommandInfo() const;
+ void SetCommandInfo(const CommandInfo &);
ChanServ::AccessGroup AccessFor(ChanServ::Channel *ci);
bool IsFounder(ChanServ::Channel *ci);