]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Pass the modes to the OnMode hook as a Modes::ChangeList, pass ModeProcessFlags too
authorAttila Molnar <attilamolnar@hush.com>
Wed, 3 Sep 2014 12:15:18 +0000 (14:15 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 3 Sep 2014 12:15:18 +0000 (14:15 +0200)
include/modules.h
src/mode.cpp
src/modules.cpp

index 4f363b2a606d754f3d57ff5faa6420968917bf55..de0faf6d4a6bcbe5f412408fcb7118d30cfe6a23 100644 (file)
@@ -598,15 +598,16 @@ class CoreExport Module : public classbase, public usecountbase
        /** Called after every MODE command sent from a user
         * Either the usertarget or the chantarget variable contains the target of the modes,
         * the actual target will have a non-NULL pointer.
-        * The modes vector contains the remainder of the mode string after the target,
-        * e.g.: "+wsi" or ["+ooo", "nick1", "nick2", "nick3"].
+        * All changed modes are available in the changelist object.
         * @param user The user sending the MODEs
         * @param usertarget The target user of the modes, NULL if the target is a channel
         * @param chantarget The target channel of the modes, NULL if the target is a user
-        * @param modes The actual modes and their parameters if any
-        * @param translate The translation types of the mode parameters
+        * @param changelist The changed modes.
+        * @param processflags Flags passed to ModeParser::Process(), see ModeParser::ModeProcessFlags
+        * for the possible flags.
+        * @param output_mode Changed modes, including '+' and '-' characters, not including any parameters
         */
-       virtual void OnMode(User* user, User* usertarget, Channel* chantarget, const std::vector<std::string>& modes, const std::vector<TranslateType>& translate);
+       virtual void OnMode(User* user, User* usertarget, Channel* chantarget, const Modes::ChangeList& changelist, ModeParser::ModeProcessFlag processflags, const std::string& output_mode);
 
        /** Allows modules to synchronize data which relates to users during a netburst.
         * When this function is called, it will be called from the module which implements
index b684af88535d92adb24a665a6beaa65d67d6cdb2..66ce313f4006a34f9f44cc397a47728f885d0fef 100644 (file)
@@ -503,7 +503,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User* user,
                else
                        targetuser->WriteFrom(user, "MODE " + LastParse);
 
-               FOREACH_MOD(OnMode, (user, targetuser, targetchannel, LastParseParams, LastParseTranslate));
+               FOREACH_MOD(OnMode, (user, targetuser, targetchannel, LastChangeList, flags, output_mode));
        }
        else if (targetchannel && parameters.size() == 2)
        {
index cb5b9c32ccc3b89b5d06147f53ecc60e246c1908..7e932ed72ba9f508246ba5f34fdbf116df74f4b1 100644 (file)
@@ -86,7 +86,7 @@ void          Module::OnUserPart(Membership*, std::string&, CUList&) { DetachEvent(I_OnU
 void           Module::OnPreRehash(User*, const std::string&) { DetachEvent(I_OnPreRehash); }
 void           Module::OnModuleRehash(User*, const std::string&) { DetachEvent(I_OnModuleRehash); }
 ModResult      Module::OnUserPreJoin(LocalUser*, Channel*, const std::string&, std::string&, const std::string&) { DetachEvent(I_OnUserPreJoin); return MOD_RES_PASSTHRU; }
-void           Module::OnMode(User*, User*, Channel*, const std::vector<std::string>&, const std::vector<TranslateType>&) { DetachEvent(I_OnMode); }
+void           Module::OnMode(User*, User*, Channel*, const Modes::ChangeList&, ModeParser::ModeProcessFlag, const std::string&) { DetachEvent(I_OnMode); }
 void           Module::OnOper(User*, const std::string&) { DetachEvent(I_OnOper); }
 void           Module::OnPostOper(User*, const std::string&, const std::string &) { DetachEvent(I_OnPostOper); }
 void           Module::OnInfo(User*) { DetachEvent(I_OnInfo); }