summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/modules.h15
-rw-r--r--include/regchannel.h22
-rw-r--r--include/services.h18
3 files changed, 25 insertions, 30 deletions
diff --git a/include/modules.h b/include/modules.h
index cfa639d08..df917581d 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -967,6 +967,20 @@ class CoreExport Module
*/
virtual void OnUserModeAdd(UserMode *um) { }
+ /** Called when a mode is about to be mlocked
+ * @param Name The mode being mlocked
+ * @param status true if its being mlocked +, false for -
+ * @param param The param, if there is one and if status is true
+ * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
+ */
+ virtual EventReturn OnMLock(ChannelModeName Name, bool status, const std::string &param) { return EVENT_CONTINUE; }
+
+ /** Called when a mode is about to be unlocked
+ * @param Name The mode being mlocked
+ * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
+ */
+ virtual EventReturn OnUnMLock(ChannelModeName Name) { return EVENT_CONTINUE; }
+
};
@@ -1009,6 +1023,7 @@ enum Implementation
I_OnServerQuit, I_OnTopicUpdated,
I_OnEncrypt, I_OnEncryptInPlace, I_OnEncryptCheckLen, I_OnDecrypt, I_OnCheckPassword,
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
+ I_OnMLock, I_OnUnMLock,
I_END
};
diff --git a/include/regchannel.h b/include/regchannel.h
index eda83a1b7..8a906c818 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -62,7 +62,7 @@ enum ChannelInfoFlag
class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
{
private:
- std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name */
+ std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name for mlock */
std::vector<ChanAccess *> access; /* List of authorized users */
std::vector<AutoKick *> akick; /* List of users to kickban */
std::vector<BadWord *> badwords; /* List of badwords */
@@ -253,14 +253,16 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
/** Set a mlock
* @param Name The mode
* @param status True for mlock on, false for mlock off
+ * @param param An optional param arg for + mlocked modes
+ * @return true on success, false on failure (module blocking)
*/
- void SetMLock(ChannelModeName Name, bool status);
+ bool SetMLock(ChannelModeName Name, bool status, const std::string param = "");
/** Remove a mlock
* @param Name The mode
- * @param status True for mlock on, false for mlock off
+ * @return true on success, false on failure (module blcoking)
*/
- void RemoveMLock(ChannelModeName Name, bool status);
+ bool RemoveMLock(ChannelModeName Name);
/** Clear all mlocks on the channel
*/
@@ -272,18 +274,6 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
*/
const size_t GetMLockCount(bool status) const;
- /** Set a channel mode param on the channel
- * @param Name The mode
- * @param param The param
- * @param true on success
- */
- bool SetParam(ChannelModeName Name, std::string Value);
-
- /** Unset a param from the channel
- * @param Name The mode
- */
- void UnsetParam(ChannelModeName Name);
-
/** Get a param from the channel
* @param Name The mode
* @param Target a string to put the param into
diff --git a/include/services.h b/include/services.h
index 5a8e84ee0..f8e48aa8a 100644
--- a/include/services.h
+++ b/include/services.h
@@ -989,14 +989,16 @@ class CoreExport Channel : public Extensible
/**
* Set a mode on a channel
* @param Name The mode name
+ * @param param Optional param arg for the mode
*/
- void SetMode(ChannelModeName Name);
+ void SetMode(ChannelModeName Name, const std::string param = "");
/**
* Set a mode on a channel
* @param Mode The mode
+ * @param param Optional param arg for the mode
*/
- void SetMode(char Mode);
+ void SetMode(char Mode, const std::string param = "");
/**
* Remove a mode from a channel
@@ -1030,18 +1032,6 @@ class CoreExport Channel : public Extensible
*/
void ClearInvites(char *client = NULL);
- /** Set a channel mode param on the channel
- * @param Name The mode
- * @param param The param
- * @param true on success
- */
- bool SetParam(ChannelModeName Name, std::string &param);
-
- /** Unset a param from the channel
- * @param Name The mode
- */
- void UnsetParam(ChannelModeName Name);
-
/** Get a param from the channel
* @param Name The mode
* @param Target a string to put the param into