summaryrefslogtreecommitdiff
path: root/include/commands.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-09-15 10:11:31 -0400
committerAdam <Adam@anope.org>2012-09-30 20:30:27 -0400
commit9ba719688161499f01c168b1aed84a563bcb5953 (patch)
treeb2ffbe3ceebf2a32820780fb76d30967af8ea50c /include/commands.h
parent1e71303ffaf263adb0cc659505caa223f7f27b85 (diff)
Make CommandSource use references, sometimes we hold them for awhile
Diffstat (limited to 'include/commands.h')
-rw-r--r--include/commands.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/commands.h b/include/commands.h
index c3a412624..45b122247 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -44,18 +44,18 @@ class CoreExport CommandSource
/* The nick executing the command */
Anope::string nick;
/* User executing the command, may be NULL */
- User *u;
+ dynamic_reference<User> u;
public:
/* The account executing the command */
- NickCore *nc;
+ dynamic_reference<NickCore> nc;
/* Where the reply should go */
CommandReply *reply;
/* Channel the command was executed on (fantasy) */
- Channel *c;
+ dynamic_reference<Channel> c;
/* The service this command is on */
- BotInfo *owner;
+ dynamic_reference<BotInfo> owner;
/* The service the reply should come from, *not* necessarily the service the command is on */
- BotInfo *service;
+ dynamic_reference<BotInfo> service;
/* The actual name of the command being executed */
Anope::string command;
/* The permission of the command being executed */
@@ -64,17 +64,18 @@ class CoreExport CommandSource
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply);
const Anope::string &GetNick() const;
- User *GetUser() const;
- AccessGroup AccessFor(ChannelInfo *ci) const;
- bool IsFounder(ChannelInfo *ci) const;
+ User *GetUser();
+ NickCore *GetAccount();
+ AccessGroup AccessFor(ChannelInfo *ci);
+ bool IsFounder(ChannelInfo *ci);
void Reply(const char *message, ...);
void Reply(const Anope::string &message);
bool HasCommand(const Anope::string &cmd);
bool HasPriv(const Anope::string &cmd);
- bool IsServicesOper() const;
- bool IsOper() const;
+ bool IsServicesOper();
+ bool IsOper();
};
/** Every services command is a class, inheriting from Command.