summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mode.h12
-rw-r--r--include/modes/cmode_b.h1
-rw-r--r--include/modes/cmode_h.h2
-rw-r--r--include/modes/cmode_k.h2
-rw-r--r--include/modes/cmode_l.h2
-rw-r--r--include/modes/cmode_o.h2
-rw-r--r--include/modes/cmode_v.h2
7 files changed, 16 insertions, 7 deletions
diff --git a/include/mode.h b/include/mode.h
index 6e2f03788..58586a001 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -55,6 +55,13 @@ enum ModeMasks {
MASK_CHANNEL = 0 /* A channel mode */
};
+/**
+ * Used by ModeHandler::ModeSet() to return the state of a mode upon a channel or user.
+ * The pair contains an activity flag, true if the mode is set with the given parameter,
+ * and the parameter of the mode (or the parameter provided) in the std::string.
+ */
+typedef std::pair<bool,std::string> ModePair;
+
/** Each mode is implemented by ONE ModeHandler class.
* You must derive ModeHandler and add the child class to
* the list of modes handled by the ircd, using
@@ -172,7 +179,8 @@ class ModeHandler : public Extensible
/**
* If your mode needs special action during a server sync to determine which side wins when comparing timestamps,
* override this function and use it to return true or false. The default implementation just returns true if
- * theirs < ours.
+ * theirs < ours. This will only be called for non-listmodes with parameters, when adding the mode and where
+ * theirs == ours (therefore the default implementation will always return false).
* @param theirs The timestamp of the remote side
* @param ours The timestamp of the local side
* @param their_param Their parameter if the mode has a parameter
@@ -195,7 +203,7 @@ class ModeHandler : public Extensible
* the current setting for this mode set locally, when the bool is true, or, the parameter given.
* This allows the local server to enforce our locally set parameters back to a remote server.
*/
- virtual std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
+ virtual ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
};
/**
diff --git a/include/modes/cmode_b.h b/include/modes/cmode_b.h
index df638005e..34b90c9b9 100644
--- a/include/modes/cmode_b.h
+++ b/include/modes/cmode_b.h
@@ -11,5 +11,6 @@ class ModeChannelBan : public ModeHandler
std::string& AddBan(userrec *user,std::string& dest,chanrec *chan,int status);
std::string& DelBan(userrec *user,std::string& dest,chanrec *chan,int status);
void DisplayList(userrec* user, chanrec* channel);
+ ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
};
diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h
index 963052180..eaf2149af 100644
--- a/include/modes/cmode_h.h
+++ b/include/modes/cmode_h.h
@@ -9,6 +9,6 @@ class ModeChannelHalfOp : public ModeHandler
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
std::string AddHalfOp(userrec *user,const char *dest,chanrec *chan,int status);
std::string DelHalfOp(userrec *user,const char *dest,chanrec *chan,int status);
- std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
+ ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
};
diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h
index 94a317df0..8434fc5c4 100644
--- a/include/modes/cmode_k.h
+++ b/include/modes/cmode_k.h
@@ -5,6 +5,6 @@ class ModeChannelKey : public ModeHandler
public:
ModeChannelKey();
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
- std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
+ ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel);
};
diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h
index 886ece324..69c132e56 100644
--- a/include/modes/cmode_l.h
+++ b/include/modes/cmode_l.h
@@ -5,6 +5,6 @@ class ModeChannelLimit : public ModeHandler
public:
ModeChannelLimit();
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
- std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
+ ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel);
};
diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h
index ad34f501c..ff166b5e2 100644
--- a/include/modes/cmode_o.h
+++ b/include/modes/cmode_o.h
@@ -9,6 +9,6 @@ class ModeChannelOp : public ModeHandler
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
std::string AddOp(userrec *user,const char *dest,chanrec *chan,int status);
std::string DelOp(userrec *user,const char *dest,chanrec *chan,int status);
- std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
+ ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
};
diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h
index f61f183c5..3e747ca9d 100644
--- a/include/modes/cmode_v.h
+++ b/include/modes/cmode_v.h
@@ -9,6 +9,6 @@ class ModeChannelVoice : public ModeHandler
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding);
std::string AddVoice(userrec *user,const char *dest,chanrec *chan,int status);
std::string DelVoice(userrec *user,const char *dest,chanrec *chan,int status);
- std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
+ ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string &parameter);
};