summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/commands.h18
-rw-r--r--include/extern.h6
-rw-r--r--include/modules.h14
3 files changed, 18 insertions, 20 deletions
diff --git a/include/commands.h b/include/commands.h
index 9f4c5a928..b7c1e28f5 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -29,9 +29,9 @@ enum CommandReturn
};
extern CoreExport Command *FindCommand(BotInfo *bi, const Anope::string &cmd);
-extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const Anope::string &cmd);
-extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &message, bool fantasy);
-extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message, bool fantasy);
+extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, ChannelInfo *ci, const Anope::string &cmd);
+extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const Anope::string &message, ChannelInfo *ci);
+extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const Anope::string &command, const Anope::string &message, ChannelInfo *ci);
enum CommandFlag
{
@@ -101,22 +101,22 @@ class CoreExport Command : public Flags<CommandFlag>
virtual CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params) = 0;
/** Called when HELP is requsted for the client this command is on.
- * @param u The user requesting help
+ * @param source The source
*/
- virtual void OnServHelp(User *u);
+ virtual void OnServHelp(CommandSource &source);
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
- * @param u The user requesting help
+ * @param source The source
* @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL")
* @return true if help was provided to the user, false otherwise.
*/
- virtual bool OnHelp(User *u, const Anope::string &subcommand);
+ virtual bool OnHelp(CommandSource &source, const Anope::string &subcommand);
/** Requested when the user provides bad syntax to this command (not enough params, etc).
- * @param u The user executing the command.
+ * @param source The source
* @param subcommand The subcommand the user tried to use
*/
- virtual void OnSyntaxError(User *u, const Anope::string &subcommand);
+ virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand);
/** Set which command permission (e.g. chanserv/forbid) is required for this command.
* @param reststr The permission required to successfully execute this command
diff --git a/include/extern.h b/include/extern.h
index d16c5e1db..de51742ab 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -146,7 +146,7 @@ E const Anope::string GetString(NickCore *nc, LanguageString string);
E const Anope::string GetString(User *u, LanguageString string);
E const Anope::string GetString(const char *domain, Anope::string language, const Anope::string &string);
E const char *const language_strings[LANG_STRING_COUNT];
-E void SyntaxError(BotInfo *bi, User *u, const Anope::string &command, LanguageString message);
+E void SyntaxError(CommandSource &source, const Anope::string &command, LanguageString message);
/*** logger.cpp ***/
E void InitLogChannels(ServerConfig *);
@@ -189,10 +189,10 @@ class CoreExport UplinkSocket : public ConnectionSocket
/**** memoserv.c ****/
E void ms_init();
-E void rsend_notify(User *u, Memo *m, const Anope::string &chan);
+E void rsend_notify(CommandSource &source, Memo *m, const Anope::string &chan);
E void check_memos(User *u);
E MemoInfo *getmemoinfo(const Anope::string &name, bool &ischan, bool &isforbid);
-E void memo_send(User *u, const Anope::string &name, const Anope::string &text, int z);
+E void memo_send(CommandSource &source, const Anope::string &name, const Anope::string &text, int z);
/**** messages.c ****/
diff --git a/include/modules.h b/include/modules.h
index cd3ba20a4..12e7884f8 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -284,11 +284,10 @@ class CoreExport Module : public Extensible
Version GetVersion() const;
/** Send a message to a user in their language, if a translation is available
- * @param from Client to send the message from
- * @param to User to send the message to
+ * @param source The source of the message
* @param fmt The message
*/
- void SendMessage(BotInfo *from, User *to, const char *fmt, ...);
+ void SendMessage(CommandSource &source, const char *fmt, ...);
/**
* Add a module provided command to the given service.
@@ -365,19 +364,18 @@ class CoreExport Module : public Extensible
* @param bi The bot the command is being run from
* @param command The command
* @param message The parameters used for the command
- * @param fantasy true if this is a fantasy command
+ * @param ci If a tanasy command, the channel the comman was used on
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
- virtual EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, bool fantasy) { return EVENT_CONTINUE; }
+ virtual EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, ChannelInfo *ci) { return EVENT_CONTINUE; }
/** Called before a command is due to be executed.
- * @param u The user executing the command
- * @param service The service the command is associated with
+ * @param source The source of the command
* @param command The command the user is executing
* @param params The parameters the user is sending
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
*/
- virtual EventReturn OnPreCommand(User *u, BotInfo *service, const Anope::string &command, const std::vector<Anope::string> &params) { return EVENT_CONTINUE; }
+ virtual EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params) { return EVENT_CONTINUE; }
/** Called after a command has been executed.
* @param source The source of the command