summaryrefslogtreecommitdiff
path: root/include/mode.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-09-03 15:05:56 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-09-03 15:05:56 +0200
commitc6c43eaf60b966870acaf152721e89b5289281b3 (patch)
treefce4987962e9a972e2cb7cc1e3a6950ebeec5005 /include/mode.h
parent05022b58f2da1a6b0d1d7134a86fa566bada4232 (diff)
Make it possible to resume processing a partially processed Modes::ChangeList
Return number of processed mode changes from ModeParser::ProcessSingle() and add a begin index parameter
Diffstat (limited to 'include/mode.h')
-rw-r--r--include/mode.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/mode.h b/include/mode.h
index 66f003b99..fbc880129 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -681,7 +681,7 @@ class CoreExport ModeParser : public fakederef<ModeParser>
void Process(const std::vector<std::string>& parameters, User* user, ModeProcessFlag flags = MODE_NONE);
/** Process a single MODE line's worth of mode changes, taking max modes and line length limits
- * into consideration.
+ * into consideration. Return value indicates how many modes were processed.
* @param user The source of the mode change, can be a server user.
* @param targetchannel Channel to apply the mode change on. NULL if changing modes on a channel.
* @param targetuser User to apply the mode change on. NULL if changing modes on a user.
@@ -689,8 +689,11 @@ class CoreExport ModeParser : public fakederef<ModeParser>
* the entire list due to MODE line length and max modes limitations.
* @param flags Optional flags controlling how the mode change is processed,
* defaults to MODE_NONE.
+ * @param beginindex Index of the first element in changelist to process. Mode changes before
+ * the element with this index are ignored.
+ * @return Number of mode changes processed from changelist.
*/
- void ProcessSingle(User* user, Channel* targetchannel, User* targetuser, Modes::ChangeList& changelist, ModeProcessFlag flags = MODE_NONE);
+ unsigned int ProcessSingle(User* user, Channel* targetchannel, User* targetuser, Modes::ChangeList& changelist, ModeProcessFlag flags = MODE_NONE, unsigned int beginindex = 0);
/** Turn a list of parameters compatible with the format of the MODE command into
* Modes::ChangeList form. All modes are processed, regardless of max modes. Unknown modes