summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-26 23:23:15 -0500
committerAdam <Adam@anope.org>2012-02-26 23:23:15 -0500
commita5b9e235ae240439608aa743c9ebb3bf6e7d342a (patch)
tree9c3040b865ace191c224a94ef525ab60581c6ba5 /include
parenta78790eac4da788a8432d0b83fa72de7853dd697 (diff)
Added chanserv:require config option to set which modes must be on all registered channels. Prevents the core from always enforcing +r on every channel, even if chanserv is not loaded.
Diffstat (limited to 'include')
-rw-r--r--include/channels.h4
-rw-r--r--include/config.h2
-rw-r--r--include/modules.h9
-rw-r--r--include/regchannel.h2
4 files changed, 14 insertions, 3 deletions
diff --git a/include/channels.h b/include/channels.h
index a4803fe00..eadde3df5 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -86,6 +86,10 @@ class CoreExport Channel : public Base, public Extensible, public Flags<ChannelF
*/
void Sync();
+ /** Check if a channels modes are correct.
+ */
+ void CheckModes();
+
/** Join a user internally to the channel
* @param u The user
*/
diff --git a/include/config.h b/include/config.h
index 99d116daa..9daa56022 100644
--- a/include/config.h
+++ b/include/config.h
@@ -446,6 +446,8 @@ class CoreExport ServerConfig
Anope::string MLock;
/* Unmlockable modes */
Anope::string NoMLock;
+ /* Modes that are required to be on registered channels */
+ Anope::string CSRequire;
/* Default botmodes on channels, defaults to ao */
Anope::string BotModes;
/* THe actual modes */
diff --git a/include/modules.h b/include/modules.h
index ce6bbba51..29e6c0881 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -938,6 +938,13 @@ class CoreExport Module : public Extensible
* @param l The log message
*/
virtual void OnLog(Log *l) { }
+
+ /** Called when a channels modes are being checked to see if they are allowed,
+ * mostly to ensure mlock/+r are set.
+ * @param c The channel
+ * @return EVENT_STOP to stop checking modes
+ */
+ virtual EventReturn OnCheckModes(Channel *c) { return EVENT_CONTINUE; }
};
/** Implementation-specific flags which may be set in ModuleManager::Attach()
@@ -957,7 +964,7 @@ enum Implementation
/* ChanServ */
I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd,
I_OnAccessDel, I_OnAccessClear, I_OnLevelChange, I_OnChanRegistered, I_OnChanUnsuspend, I_OnCreateChan, I_OnDelChan, I_OnChannelCreate,
- I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick,
+ I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick, I_OnCheckModes,
I_OnChanInfo, I_OnFindChan, I_OnCheckPriv, I_OnGroupCheckPriv,
/* BotServ */
diff --git a/include/regchannel.h b/include/regchannel.h
index 93a242a28..d7c6a8492 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -437,8 +437,6 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
void ClearLevels();
};
-extern void check_modes(Channel *c);
-
extern ChannelInfo *cs_findchan(const Anope::string &chan);
extern bool IsFounder(User *user, ChannelInfo *ci);
extern void update_cs_lastseen(User *user, ChannelInfo *ci);