summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/account.h73
-rw-r--r--include/channels.h2
-rw-r--r--include/defs.h1
-rw-r--r--include/extensible.h295
-rw-r--r--include/lists.h1
-rw-r--r--include/modules.h23
-rw-r--r--include/modules/bs_badwords.h70
-rw-r--r--include/modules/bs_kick.h45
-rw-r--r--include/modules/cs_log.h41
-rw-r--r--include/modules/cs_mode.h87
-rw-r--r--include/modules/cs_suspend.h19
-rw-r--r--include/modules/ns_cert.h61
-rw-r--r--include/modules/ns_suspend.h19
-rw-r--r--include/regchannel.h206
-rw-r--r--include/service.h2
15 files changed, 579 insertions, 366 deletions
diff --git a/include/account.h b/include/account.h
index 4d6bd714f..15fc0f20f 100644
--- a/include/account.h
+++ b/include/account.h
@@ -27,15 +27,6 @@ extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
/* A registered nickname.
* It matters that Base is here before Extensible (it is inherited by Serializable)
- *
- * Possible flags:
- * NO_EXPIRE - Nick never expires
- * HELD - This nick is being held after a kill by an enforcer client
- * or is being SVSHeld.
- * COLLIDED - We are taking over this nick, either by SVSNICK or KILL
- * and are waiting for the confirmation of either of these actions to
- * proceed. This is checked in NickAlias::OnCancel
- *
*/
class CoreExport NickAlias : public Serializable, public Extensible
{
@@ -112,26 +103,6 @@ class CoreExport NickAlias : public Serializable, public Extensible
/* A registered account. Each account must have a NickAlias with the same nick as the
* account's display.
* It matters that Base is here before Extensible (it is inherited by Serializable)
- *
- * Possible flags:
- * KILLPROTECT - Kill other users who try to take this nick
- * SECURE - Don't recognize unless identified
- * MSG - Use PRIVMSG instead of notice
- * MEMO_HARDMAX - Don't allow user to change memo limit
- * MEMO_SIGNON - Notify of memos at signon and unaway
- * MEMO_RECEIEVE - Notify of new memos when sent
- * PRIVATE - Don't show in LIST to non-servadmins
- * HIDE_EMAIL - Don't show email in INFO
- * HIDE_MASK - Don't show last seen address in INFO
- * HIDE_QUIT - Don't show last quit message in INFO
- * KILL_QUICK - Kill quicker
- * KILL_IMMED - Kill immediately
- * MEMO_MAIL - User gets email on memo
- * HIDE_STATUS - Don't show services access status
- * SUSPEND - Nickname is suspended
- * AUTOOP - Autoop nickname in channels
- * UNCONFIRMED - Account has not had email address confirmed
- * STATS - ChanStats is enabled for this user
*/
class CoreExport NickCore : public Serializable, public Extensible
{
@@ -143,15 +114,11 @@ class CoreExport NickCore : public Serializable, public Extensible
/* User password in form of hashm:data */
Anope::string pass;
Anope::string email;
- /* Greet associated with the account, sometimes sent when the user joins a channel */
- Anope::string greet;
/* Locale name of the language of the user. Empty means default language */
Anope::string language;
/* Access list, contains user@host masks of users who get certain privileges based
* on if NI_SECURE is set and what (if any) kill protection is enabled. */
std::vector<Anope::string> access;
- /* SSL certificate list. Users who have a matching certificate may be automatically logged in */
- std::vector<Anope::string> cert;
MemoInfo memos;
/* Nicknames registered that are grouped to this account.
@@ -242,46 +209,6 @@ class CoreExport NickCore : public Serializable, public Extensible
*/
bool IsOnAccess(const User *u) const;
- /** Add an entry to the nick's certificate list
- *
- * @param entry The fingerprint to add to the cert list
- *
- * Adds a new entry into the cert list.
- */
- void AddCert(const Anope::string &entry);
-
- /** Get an entry from the nick's cert list by index
- *
- * @param entry Index in the certificaate list vector to retrieve
- * @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
- *
- * Retrieves an entry from the certificate list corresponding to the given index.
- */
- Anope::string GetCert(unsigned entry) const;
-
- /** Find an entry in the nick's cert list
- *
- * @param entry The fingerprint to search for
- * @return True if the fingerprint is found in the cert list, false otherwise
- *
- * Search for an fingerprint within the cert list.
- */
- bool FindCert(const Anope::string &entry) const;
-
- /** Erase a fingerprint from the nick's certificate list
- *
- * @param entry The fingerprint to remove
- *
- * Removes the specified fingerprint from the cert list.
- */
- void EraseCert(const Anope::string &entry);
-
- /** Clears the entire nick's cert list
- *
- * Deletes all the memory allocated in the certificate list vector and then clears the vector.
- */
- void ClearCert();
-
/** Finds an account
* @param nick The account name to find
* @return The account, if it exists
diff --git a/include/channels.h b/include/channels.h
index bdc273415..377b4eebf 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -48,6 +48,8 @@ class CoreExport Channel : public Base, public Extensible
time_t creation_time;
/* If the channel has just been created in a netjoin */
bool syncing;
+ /* Is configured in the conf as a channel bots should be in */
+ bool botchannel;
/* Users in the channel */
typedef std::map<User *, ChanUserContainer *> ChanUserList;
diff --git a/include/defs.h b/include/defs.h
index e1c7613bc..fc0ad8e6a 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -32,7 +32,6 @@ class InfoFormatter;
class IRCDProto;
class ListenSocket;
class Log;
-class LogInfo;
class Memo;
class MessageSource;
class Module;
diff --git a/include/extensible.h b/include/extensible.h
index d47690da6..bd92e5635 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -12,109 +12,242 @@
#include "anope.h"
#include "serialize.h"
+#include "service.h"
+#include "logger.h"
-/* All items added to Extensible must inherit from this.
- */
-class CoreExport ExtensibleItem
+class Extensible;
+
+class CoreExport ExtensibleBase : public Service
{
+ protected:
+ std::map<Extensible *, void *> items;
+
+ ExtensibleBase(Module *m, const Anope::string &n);
+ ~ExtensibleBase();
+
public:
- virtual ~ExtensibleItem() { }
+ virtual void Unset(Extensible *obj) = 0;
- virtual const Anope::string *Serialize() { return NULL; }
+ /* called when an object we are keep track of is serializing */
+ virtual void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &) const { }
+ virtual void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &) { }
};
-/** Common class used to Extensible::Extend as it inherits from both ExtensibleItem
- * and whatever basic object you're trying to store.
- * Eg, obj->Extend(key, new ExtensibleItemClass<Anope::string>(value));
- */
-template<typename T> struct CoreExport ExtensibleItemClass : T, ExtensibleItem
+class CoreExport Extensible
{
- ExtensibleItemClass(const T& t) : T(t) { }
-};
+ public:
+ std::set<ExtensibleBase *> extension_items;
-/* Used to attach metadata to this object that is automatically saved
- * when the object is saved (assuming the object's Serialize method
- * correcly calls Extensible::ExtensibleSerialize).
- */
-struct CoreExport ExtensibleMetadata : ExtensibleItemClass<Anope::string>
-{
- ExtensibleMetadata(const Anope::string &t) : ExtensibleItemClass<Anope::string>(t) { }
+ virtual ~Extensible();
- const Anope::string *Serialize() anope_override { return this; }
+ template<typename T> T* GetExt(const Anope::string &name) const;
+ bool HasExt(const Anope::string &name) const;
+
+ template<typename T> T* Extend(const Anope::string &name, const T &what);
+ template<typename T> T* Extend(const Anope::string &name);
+ template<typename T> T* Require(const Anope::string &name);
+ template<typename T> void Shrink(const Anope::string &name);
+
+ static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
+ static void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &data);
};
-/* Used to attach arbitrary objects to this object using unique keys */
-class CoreExport Extensible
+template<typename T>
+class BaseExtensibleItem : public ExtensibleBase
{
- private:
- typedef std::map<Anope::string, ExtensibleItem *> extensible_map;
- extensible_map *extension_items;
+ protected:
+ virtual T *Create(Extensible *) = 0;
public:
- /** Default constructor
- */
- Extensible();
+ BaseExtensibleItem(Module *m, const Anope::string &n) : ExtensibleBase(m, n) { }
- /** Destructor, deletes all of the extensible items in this object
- * then clears the map
- */
- virtual ~Extensible();
-
- /** Extend an Extensible class.
- *
- * @param key The key parameter is an arbitary string which identifies the extension data
- * @param p This parameter is a pointer to an ExtensibleItem or ExtensibleItemBase derived class
- *
- * You must provide a key to store the data as via the parameter 'key'.
- * The data will be inserted into the map. If the data already exists, it will be overwritten.
- */
- void Extend(const Anope::string &key, ExtensibleItem *p = NULL);
-
- void ExtendMetadata(const Anope::string &key, const Anope::string &value = "");
-
- /** Shrink an Extensible class.
- *
- * @param key The key parameter is an arbitary string which identifies the extension data
- *
- * You must provide a key name. The given key name will be removed from the classes data. If
- * you provide a nonexistent key (case is important) then the function will return false.
- * @return Returns true on success.
- */
- bool Shrink(const Anope::string &key);
-
- /** Get an extension item.
- *
- * @param key The key parameter is an arbitary string which identifies the extension data
- * @return The item found
- */
- template<typename T> T GetExt(const Anope::string &key) const
+ ~BaseExtensibleItem()
{
- if (this->extension_items)
+ for (std::map<Extensible *, void *>::iterator it = items.begin(); it != items.end(); ++it)
{
- extensible_map::const_iterator it = this->extension_items->find(key);
- if (it != this->extension_items->end())
- return anope_dynamic_static_cast<T>(it->second);
+ T *value = static_cast<T *>(it->second);
+
+ items.erase(it->first);
+ it->first->extension_items.erase(this);
+ delete value;
}
+ }
+
+ T* Set(Extensible *obj, const T &value)
+ {
+ T* t = Set(obj);
+ *t = value;
+ return t;
+ }
+
+ T* Set(Extensible *obj)
+ {
+ T* t = Create(obj);
+ Unset(obj);
+ items[obj] = t;
+ obj->extension_items.insert(this);
+ return t;
+ }
+
+ void Unset(Extensible *obj) anope_override
+ {
+ T *value = Get(obj);
+ items.erase(obj);
+ obj->extension_items.erase(this);
+ delete value;
+ }
+ T* Get(const Extensible *obj) const
+ {
+ std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
+ if (it != items.end())
+ return static_cast<T *>(it->second);
return NULL;
}
- /** Check if an extension item exists.
- *
- * @param key The key parameter is an arbitary string which identifies the extension data
- * @return True if the item was found.
- */
- bool HasExt(const Anope::string &key) const;
-
- /** Get a list of all extension items names.
- * @param list A deque of strings to receive the list
- * @return This function writes a list of all extension items stored
- * in this object by name into the given deque and returns void.
- */
- void GetExtList(std::deque<Anope::string> &list) const;
-
- void ExtensibleSerialize(Serialize::Data &data) const;
- void ExtensibleUnserialize(Serialize::Data &data);
+ bool HasExt(const Extensible *obj) const
+ {
+ return items.find(const_cast<Extensible *>(obj)) != items.end();
+ }
+
+ T* Require(Extensible *obj)
+ {
+ T* t = Get(obj);
+ if (t)
+ return t;
+
+ return Set(obj);
+ }
+};
+
+template<typename T>
+class ExtensibleItem : public BaseExtensibleItem<T>
+{
+ protected:
+ T* Create(Extensible *obj) anope_override
+ {
+ return new T(obj);
+ }
+ public:
+ ExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
};
+template<typename T>
+class PrimitiveExtensibleItem : public BaseExtensibleItem<T>
+{
+ protected:
+ T* Create(Extensible *obj) anope_override
+ {
+ return new T();
+ }
+ public:
+ PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<T>(m, n) { }
+};
+
+template<>
+class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
+{
+ protected:
+ bool* Create(Extensible *) anope_override
+ {
+ return NULL;
+ }
+ public:
+ PrimitiveExtensibleItem(Module *m, const Anope::string &n) : BaseExtensibleItem<bool>(m, n) { }
+};
+
+template<typename T>
+class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
+{
+ public:
+ SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<T>(m, n) { }
+
+ void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
+ {
+ T* t = this->Get(e);
+ data[this->name] << *t;
+ }
+
+ void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
+ {
+ T* t = this->Require(e);
+ data[this->name] >> *t;
+ }
+};
+
+template<>
+class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
+{
+ public:
+ SerializableExtensibleItem(Module *m, const Anope::string &n) : PrimitiveExtensibleItem<bool>(m, n) { }
+
+ void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const anope_override
+ {
+ data[this->name] << true;
+ }
+
+ void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) anope_override
+ {
+ bool b;
+ data[this->name] >> b;
+ if (b)
+ this->Set(e);
+ }
+};
+
+template<typename T>
+struct ExtensibleRef : ServiceReference<BaseExtensibleItem<T> >
+{
+ ExtensibleRef(const Anope::string &n) : ServiceReference<BaseExtensibleItem<T> >("Extensible", n) { }
+};
+
+template<typename T>
+T* Extensible::GetExt(const Anope::string &name) const
+{
+ ExtensibleRef<T> ref(name);
+ if (ref)
+ return ref->Get(this);
+
+ Log(LOG_DEBUG) << "GetExt for nonexistent type " << name << " on " << static_cast<const void *>(this);
+ return NULL;
+}
+
+template<typename T>
+T* Extensible::Extend(const Anope::string &name, const T &what)
+{
+ T* t = Extend<T>(name);
+ *t = what;
+ return t;
+}
+
+template<typename T>
+T* Extensible::Extend(const Anope::string &name)
+{
+ ExtensibleRef<T> ref(name);
+ if (ref)
+ return ref->Set(this);
+
+ Log(LOG_DEBUG) << "Extend for nonexistent type " << name << " on " << static_cast<void *>(this);
+ return NULL;
+}
+
+template<typename T>
+T* Extensible::Require(const Anope::string &name)
+{
+ if (HasExt(name))
+ return GetExt<T>(name);
+ else
+ return Extend<T>(name);
+}
+
+template<typename T>
+void Extensible::Shrink(const Anope::string &name)
+{
+ ExtensibleRef<T> ref(name);
+ if (ref)
+ ref->Unset(this);
+ else
+ Log(LOG_DEBUG) << "Shrink for nonexistent type " << name << " on " << static_cast<void *>(this);
+}
+
#endif // EXTENSIBLE_H
diff --git a/include/lists.h b/include/lists.h
index 667c643b6..37b3d61a8 100644
--- a/include/lists.h
+++ b/include/lists.h
@@ -87,6 +87,7 @@ class CoreExport InfoFormatter
InfoFormatter(NickCore *nc);
void Process(std::vector<Anope::string> &);
Anope::string &operator[](const Anope::string &key);
+ void AddOption(const Anope::string &opt);
};
#endif // LISTS_H
diff --git a/include/modules.h b/include/modules.h
index c430767db..ffb8bbcc7 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -626,9 +626,10 @@ class CoreExport Module : public Extensible
virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what) { throw NotImplementedException(); }
/** Called right before a channel is dropped
+ * @param source The user dropping the channel
* @param ci The channel
*/
- virtual void OnChanDrop(ChannelInfo *ci) { throw NotImplementedException(); }
+ virtual EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) { throw NotImplementedException(); }
/** Called when a channel is registered
* @param ci The channel
@@ -823,6 +824,10 @@ class CoreExport Module : public Extensible
*/
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
+ /** Called when a user uses botserv/info on a bot or channel.
+ */
+ virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) { throw NotImplementedException(); }
+
/** Check whether a username and password is correct
* @param u The user trying to identify, if applicable.
* @param req The login request
@@ -887,20 +892,20 @@ class CoreExport Module : public Extensible
/** Called when a mode is set on a channel
* @param c The channel
* @param setter The user or server that is setting the mode
- * @param mname The mode name
+ * @param mode The mode
* @param param The mode param, if there is one
* @return EVENT_STOP to make mlock/secureops etc checks not happen
*/
- virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string &param) { throw NotImplementedException(); }
+ virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param) { throw NotImplementedException(); }
/** Called when a mode is unset on a channel
* @param c The channel
* @param setter The user or server that is unsetting the mode
- * @param mname The mode name
+ * @param mode The mode
* @param param The mode param, if there is one
* @return EVENT_STOP to make mlock/secureops etc checks not happen
*/
- virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string &param) { throw NotImplementedException(); }
+ virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param) { throw NotImplementedException(); }
/** Called when a mode is set on a user
* @param u The user
@@ -1053,6 +1058,14 @@ class CoreExport Module : public Extensible
* channels, etc.
*/
virtual void OnExpireTick() { throw NotImplementedException(); }
+
+ /** Called when a nick is validated. That is, to determine if a user is permissted
+ * to be on the given nick.
+ * @param u The user
+ * @param na The nick they are on
+ * @return EVENT_STOP to force the user off of the nick
+ */
+ virtual EventReturn OnNickValidate(User *u, NickAlias *na) { throw NotImplementedException(); }
};
/** Used to manage modules.
diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h
new file mode 100644
index 000000000..4275226cc
--- /dev/null
+++ b/include/modules/bs_badwords.h
@@ -0,0 +1,70 @@
+/* BotServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+/** Flags for badwords
+ */
+enum BadWordType
+{
+ /* Always kicks if the word is said */
+ BW_ANY,
+ /* User must way the entire word */
+ BW_SINGLE,
+ /* The word has to start with the badword */
+ BW_START,
+ /* The word has to end with the badword */
+ BW_END
+};
+
+/* Structure used to contain bad words. */
+struct BadWord
+{
+ Anope::string chan;
+ Anope::string word;
+ BadWordType type;
+
+ protected:
+ BadWord() { }
+};
+
+struct BadWords
+{
+ /** Add a badword to the badword list
+ * @param word The badword
+ * @param type The type (SINGLE START END)
+ * @return The badword
+ */
+ virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0;
+
+ /** Get a badword structure by index
+ * @param index The index
+ * @return The badword
+ */
+ virtual BadWord* GetBadWord(unsigned index) const = 0;
+
+ /** Get how many badwords are on this channel
+ * @return The number of badwords in the vector
+ */
+ virtual unsigned GetBadWordCount() const = 0;
+
+ /** Remove a badword
+ * @param index The index of the badword
+ */
+ virtual void EraseBadWord(unsigned index) = 0;
+
+ /** Clear all badwords from the channel
+ */
+ virtual void ClearBadWords() = 0;
+
+ virtual void Check() = 0;
+};
+
diff --git a/include/modules/bs_kick.h b/include/modules/bs_kick.h
new file mode 100644
index 000000000..e1c43cc8c
--- /dev/null
+++ b/include/modules/bs_kick.h
@@ -0,0 +1,45 @@
+/* BotServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ *
+ *
+ */
+
+/* Indices for TTB (Times To Ban) */
+enum
+{
+ TTB_BOLDS,
+ TTB_COLORS,
+ TTB_REVERSES,
+ TTB_UNDERLINES,
+ TTB_BADWORDS,
+ TTB_CAPS,
+ TTB_FLOOD,
+ TTB_REPEAT,
+ TTB_ITALICS,
+ TTB_AMSGS,
+ TTB_SIZE
+};
+
+struct KickerData
+{
+ bool amsgs, badwords, bolds, caps, colors, flood, italics, repeat, reverses, underlines;
+ int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
+ int16_t capsmin, capspercent; /* For CAPS kicker */
+ int16_t floodlines, floodsecs; /* For FLOOD kicker */
+ int16_t repeattimes; /* For REPEAT kicker */
+
+ bool dontkickops, dontkickvoices;
+
+ protected:
+ KickerData() { }
+
+ public:
+ virtual void Check(ChannelInfo *ci) = 0;
+};
diff --git a/include/modules/cs_log.h b/include/modules/cs_log.h
new file mode 100644
index 000000000..555a44e50
--- /dev/null
+++ b/include/modules/cs_log.h
@@ -0,0 +1,41 @@
+/* ChanServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+struct LogSetting
+{
+ Anope::string chan;
+ /* Our service name of the command */
+ Anope::string service_name;
+ /* The name of the client the command is on */
+ Anope::string command_service;
+ /* Name of the command to the user, can have spaces */
+ Anope::string command_name;
+ Anope::string method, extra;
+ Anope::string creator;
+ time_t created;
+
+ protected:
+ LogSetting() { }
+};
+
+struct LogSettings : Serialize::Checker<std::vector<LogSetting *> >
+{
+ typedef std::vector<LogSetting *>::iterator iterator;
+
+ protected:
+ LogSettings() : Serialize::Checker<std::vector<LogSetting *> >("LogSetting")
+ {
+ }
+
+ public:
+ virtual LogSetting *Create() = 0;
+};
+
diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h
new file mode 100644
index 000000000..4d016e672
--- /dev/null
+++ b/include/modules/cs_mode.h
@@ -0,0 +1,87 @@
+/* ChanServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+struct ModeLock
+{
+ Anope::string ci;
+ bool set;
+ Anope::string name;
+ Anope::string param;
+ Anope::string setter;
+ time_t created;
+
+ protected:
+ ModeLock() { }
+};
+
+struct ModeLocks
+{
+ typedef std::vector<ModeLock *> ModeList;
+
+ /** Check if a mode is mlocked
+ * @param mode The mode
+ * @param An optional param
+ * @param status True to check mlock on, false for mlock off
+ * @return true on success, false on fail
+ */
+ virtual bool HasMLock(ChannelMode *mode, const Anope::string &param, bool status) const = 0;
+
+ /** Set a mlock
+ * @param mode The mode
+ * @param status True for mlock on, false for mlock off
+ * @param param An optional param arg for + mlocked modes
+ * @param setter Who is setting the mlock
+ * @param created When the mlock was created
+ * @return true on success, false on failure (module blocking)
+ */
+ virtual bool SetMLock(ChannelMode *mode, bool status, const Anope::string &param = "", Anope::string setter = "", time_t created = Anope::CurTime) = 0;
+
+ /** Remove a mlock
+ * @param mode The mode
+ * @param status True for mlock on, false for mlock off
+ * @param param The param of the mode, required if it is a list or status mode
+ * @return true on success, false on failure
+ */
+ virtual bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string &param = "") = 0;
+
+ virtual void RemoveMLock(ModeLock *mlock) = 0;
+
+ /** Clear all mlocks on the channel
+ */
+ virtual void ClearMLock() = 0;
+
+ /** Get all of the mlocks for this channel
+ * @return The mlocks
+ */
+ virtual const ModeList &GetMLock() const = 0;
+
+ /** Get a list of mode locks on a channel
+ * @param name The mode name to get a list of
+ * @return a list of mlocks for the given mode
+ */
+ virtual std::list<ModeLock *> GetModeLockList(const Anope::string &name) = 0;
+
+ /** Get details for a specific mlock
+ * @param mname The mode name
+ * @param An optional param to match with
+ * @return The MLock, if any
+ */
+ virtual const ModeLock *GetMLock(const Anope::string &mname, const Anope::string &param = "") = 0;
+
+ /** Get the current mode locks as a string
+ * @param complete True to show mlock parameters aswell
+ * @return A string of mode locks, eg: +nrt
+ */
+ virtual Anope::string GetMLockAsString(bool complete) const = 0;
+
+ virtual void Check() = 0;
+};
+
diff --git a/include/modules/cs_suspend.h b/include/modules/cs_suspend.h
new file mode 100644
index 000000000..dbdd3b9e9
--- /dev/null
+++ b/include/modules/cs_suspend.h
@@ -0,0 +1,19 @@
+/* ChanServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+struct CSSuspendInfo
+{
+ Anope::string chan, by, reason;
+ time_t time, expires;
+
+ protected:
+ CSSuspendInfo() { }
+};
diff --git a/include/modules/ns_cert.h b/include/modules/ns_cert.h
new file mode 100644
index 000000000..8587cdfb2
--- /dev/null
+++ b/include/modules/ns_cert.h
@@ -0,0 +1,61 @@
+/* NickServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+struct NSCertList
+{
+ protected:
+ NSCertList() { }
+ public:
+
+ /** Add an entry to the nick's certificate list
+ *
+ * @param entry The fingerprint to add to the cert list
+ *
+ * Adds a new entry into the cert list.
+ */
+ virtual void AddCert(const Anope::string &entry) = 0;
+
+ /** Get an entry from the nick's cert list by index
+ *
+ * @param entry Index in the certificaate list vector to retrieve
+ * @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
+ *
+ * Retrieves an entry from the certificate list corresponding to the given index.
+ */
+ virtual Anope::string GetCert(unsigned entry) const = 0;
+
+ virtual unsigned GetCertCount() const = 0;
+
+ /** Find an entry in the nick's cert list
+ *
+ * @param entry The fingerprint to search for
+ * @return True if the fingerprint is found in the cert list, false otherwise
+ *
+ * Search for an fingerprint within the cert list.
+ */
+ virtual bool FindCert(const Anope::string &entry) const = 0;
+
+ /** Erase a fingerprint from the nick's certificate list
+ *
+ * @param entry The fingerprint to remove
+ *
+ * Removes the specified fingerprint from the cert list.
+ */
+ virtual void EraseCert(const Anope::string &entry) = 0;
+
+ /** Clears the entire nick's cert list
+ *
+ * Deletes all the memory allocated in the certificate list vector and then clears the vector.
+ */
+ virtual void ClearCert() = 0;
+
+ virtual void Check() = 0;
+};
diff --git a/include/modules/ns_suspend.h b/include/modules/ns_suspend.h
new file mode 100644
index 000000000..59f3d5d58
--- /dev/null
+++ b/include/modules/ns_suspend.h
@@ -0,0 +1,19 @@
+/* NickServ core functions
+ *
+ * (C) 2003-2013 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+struct NSSuspendInfo
+{
+ Anope::string nick, by, reason;
+ time_t when, expires;
+
+ protected:
+ NSSuspendInfo() { }
+};
diff --git a/include/regchannel.h b/include/regchannel.h
index 65d3236ef..f04156d89 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -22,49 +22,6 @@ typedef Anope::hash_map<ChannelInfo *> registered_channel_map;
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
-/* Indices for TTB (Times To Ban) */
-enum
-{
- TTB_BOLDS,
- TTB_COLORS,
- TTB_REVERSES,
- TTB_UNDERLINES,
- TTB_BADWORDS,
- TTB_CAPS,
- TTB_FLOOD,
- TTB_REPEAT,
- TTB_ITALICS,
- TTB_AMSGS,
- TTB_SIZE
-};
-
-/** Flags for badwords
- */
-enum BadWordType
-{
- /* Always kicks if the word is said */
- BW_ANY,
- /* User must way the entire word */
- BW_SINGLE,
- /* The word has to start with the badword */
- BW_START,
- /* The word has to end with the badword */
- BW_END
-};
-
-/* Structure used to contain bad words. */
-struct CoreExport BadWord : Serializable
-{
- Serialize::Reference<ChannelInfo> ci;
- Anope::string word;
- BadWordType type;
-
- BadWord();
- ~BadWord();
- void Serialize(Serialize::Data &data) const anope_override;
- static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
-};
-
/* AutoKick data. */
class CoreExport AutoKick : public Serializable
{
@@ -86,74 +43,7 @@ class CoreExport AutoKick : public Serializable
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
};
-struct CoreExport ModeLock : Serializable
-{
- public:
- Serialize::Reference<ChannelInfo> ci;
- bool set;
- Anope::string name;
- Anope::string param;
- Anope::string setter;
- time_t created;
-
- ModeLock(ChannelInfo *ch, bool s, const Anope::string &n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime);
- ~ModeLock();
-
- void Serialize(Serialize::Data &data) const anope_override;
- static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
-};
-
-struct CoreExport LogSetting : Serializable
-{
- Serial