summaryrefslogtreecommitdiff
path: root/include/modules/nickserv
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-12-31 13:01:18 -0500
committerAdam <Adam@anope.org>2015-12-31 13:01:18 -0500
commit1b24c96ab07d99e5d95ec9337e7b541696b91eb3 (patch)
tree4524a0bccec9842bc962bb96471608aab719c773 /include/modules/nickserv
parent17b7508058162a722120dd7a9d95c20b979af2e9 (diff)
Rename haader file names to be consistent with module names
Diffstat (limited to 'include/modules/nickserv')
-rw-r--r--include/modules/nickserv/access.h22
-rw-r--r--include/modules/nickserv/ajoin.h25
-rw-r--r--include/modules/nickserv/cert.h66
-rw-r--r--include/modules/nickserv/drop.h22
-rw-r--r--include/modules/nickserv/group.h22
-rw-r--r--include/modules/nickserv/info.h24
-rw-r--r--include/modules/nickserv/set.h26
-rw-r--r--include/modules/nickserv/set_misc.h25
-rw-r--r--include/modules/nickserv/suspend.h53
-rw-r--r--include/modules/nickserv/update.h21
10 files changed, 306 insertions, 0 deletions
diff --git a/include/modules/nickserv/access.h b/include/modules/nickserv/access.h
new file mode 100644
index 000000000..73a625f3d
--- /dev/null
+++ b/include/modules/nickserv/access.h
@@ -0,0 +1,22 @@
+/*
+ *
+ * (C) 2003-2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ */
+
+class NickAccess : public Serialize::Object
+{
+ public:
+ using Serialize::Object::Object;
+
+ virtual NickServ::Account *GetAccount() anope_abstract;
+ virtual void SetAccount(NickServ::Account *) anope_abstract;
+
+ virtual Anope::string GetMask() anope_abstract;
+ virtual void SetMask(const Anope::string &) anope_abstract;
+};
+
+static Serialize::TypeReference<NickAccess> nsaccess("NSAccess");
+
diff --git a/include/modules/nickserv/ajoin.h b/include/modules/nickserv/ajoin.h
new file mode 100644
index 000000000..7b4cc20e5
--- /dev/null
+++ b/include/modules/nickserv/ajoin.h
@@ -0,0 +1,25 @@
+/*
+ *
+ * (C) 2013-2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ */
+
+class AutoJoin : public Serialize::Object
+{
+ protected:
+ using Serialize::Object::Object;
+
+ public:
+ virtual NickServ::Account *GetOwner() anope_abstract;
+ virtual void SetOwner(NickServ::Account *acc) anope_abstract;
+
+ virtual Anope::string GetChannel() anope_abstract;
+ virtual void SetChannel(const Anope::string &c) anope_abstract;
+
+ virtual Anope::string GetKey() anope_abstract;
+ virtual void SetKey(const Anope::string &k) anope_abstract;
+};
+
+static Serialize::TypeReference<AutoJoin> autojoin("AutoJoin");
diff --git a/include/modules/nickserv/cert.h b/include/modules/nickserv/cert.h
new file mode 100644
index 000000000..be75fb9bf
--- /dev/null
+++ b/include/modules/nickserv/cert.h
@@ -0,0 +1,66 @@
+/* NickServ core functions
+ *
+ * (C) 2003-2014 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.
+ */
+
+class NSCertEntry;
+
+class CertService : public Service
+{
+ public:
+ CertService(Module *c) : Service(c, "CertService", "certs") { }
+
+ virtual NickServ::Account* FindAccountFromCert(const Anope::string &cert) anope_abstract;
+
+ virtual bool Matches(User *, NickServ::Account *) anope_abstract;
+
+ virtual NSCertEntry *FindCert(const std::vector<NSCertEntry *> &cl, const Anope::string &certfp) anope_abstract;
+};
+
+static ServiceReference<CertService> certservice("CertService", "certs");
+
+class NSCertEntry : public Serialize::Object
+{
+ public:
+ using Serialize::Object::Object;
+
+ virtual NickServ::Account *GetAccount() anope_abstract;
+ virtual void SetAccount(NickServ::Account *) anope_abstract;
+
+ virtual Anope::string GetCert() anope_abstract;
+ virtual void SetCert(const Anope::string &) anope_abstract;
+};
+
+static Serialize::TypeReference<NSCertEntry> certentry("NSCertEntry");
+
+namespace Event
+{
+ struct CoreExport NickCertEvents : Events
+ {
+ /** Called when a user adds an entry to their cert list
+ * @param nc The nick
+ * @param entry The entry
+ */
+ virtual void OnNickAddCert(NickServ::Account *nc, const Anope::string &entry) anope_abstract;
+
+ /** Called from NickServ::Account::EraseCert()
+ * @param nc pointer to the NickServ::Account
+ * @param entry The fingerprint
+ */
+ virtual void OnNickEraseCert(NickServ::Account *nc, const Anope::string &entry) anope_abstract;
+
+ /** called from NickServ::Account::ClearCert()
+ * @param nc pointer to the NickServ::Account
+ */
+ virtual void OnNickClearCert(NickServ::Account *nc) anope_abstract;
+ };
+}
+
+
+template<> struct EventName<Event::NickCertEvents> { static constexpr const char *const name = "OnNickCert"; };
diff --git a/include/modules/nickserv/drop.h b/include/modules/nickserv/drop.h
new file mode 100644
index 000000000..bae9d77b6
--- /dev/null
+++ b/include/modules/nickserv/drop.h
@@ -0,0 +1,22 @@
+/*
+ *
+ * (C) 2003-2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ */
+
+namespace Event
+{
+ struct CoreExport NickDrop : Events
+ {
+ /** Called when a nick is dropped
+ * @param source The source of the command
+ * @param na The nick
+ */
+ virtual void OnNickDrop(CommandSource &source, NickServ::Nick *na) anope_abstract;
+ };
+ extern CoreExport EventHandlers<NickDrop> OnNickDrop;
+}
+
+template<> struct EventName<Event::NickDrop> { static constexpr const char *const name = "OnNickDrop"; };
diff --git a/include/modules/nickserv/group.h b/include/modules/nickserv/group.h
new file mode 100644
index 000000000..caa568a9e
--- /dev/null
+++ b/include/modules/nickserv/group.h
@@ -0,0 +1,22 @@
+/*
+ *
+ * (C) 2003-2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ */
+
+namespace Event
+{
+ struct CoreExport NickGroup : Events
+ {
+ /** Called when a user groups their nick
+ * @param u The user grouping
+ * @param target The target they're grouping to
+ */
+ virtual void OnNickGroup(User *u, NickServ::Nick *target) anope_abstract;
+ };
+}
+
+template<> struct EventName<Event::NickGroup> { static constexpr const char *const name = "OnNickGroup"; };
diff --git a/include/modules/nickserv/info.h b/include/modules/nickserv/info.h
new file mode 100644
index 000000000..e816cc356
--- /dev/null
+++ b/include/modules/nickserv/info.h
@@ -0,0 +1,24 @@
+/*
+ *
+ * (C) 2003-2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ */
+
+namespace Event
+{
+ struct CoreExport NickInfo : Events
+ {
+ /** Called when a user requests info for a nick
+ * @param source The user requesting info
+ * @param na The nick the user is requesting info from
+ * @param info Data to show the user requesting information
+ * @param show_hidden true if we should show the user everything
+ */
+ virtual void OnNickInfo(CommandSource &source, NickServ::Nick *na, InfoFormatter &info, bool show_hidden) anope_abstract;
+ };
+}
+
+template<> struct EventName<Event::NickInfo> { static constexpr const char *const name = "OnNickInfo"; };
diff --git a/include/modules/nickserv/set.h b/include/modules/nickserv/set.h
new file mode 100644
index 000000000..c6b86032b
--- /dev/null
+++ b/include/modules/nickserv/set.h
@@ -0,0 +1,26 @@
+/*
+ *
+ * (C) 2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ */
+
+namespace Event
+{
+ struct CoreExport SetNickOption : Events
+ {
+ /** Called when a nickserv/set command is used.
+ * @param source The source of the command
+ * @param cmd The command
+ * @param nc The nickcore being modifed
+ * @param setting The setting passed to the command. Probably ON/OFF.
+ * @return EVENT_STOP to halt immediately
+ */
+ virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickServ::Account *nc, const Anope::string &setting) anope_abstract;
+ };
+ static EventHandlersReference<SetNickOption> OnSetNickOption;
+}
+
+template<> struct EventName<Event::SetNickOption> { static constexpr const char *const name = "OnSetNickOption"; };
diff --git a/include/modules/nickserv/set_misc.h b/include/modules/nickserv/set_misc.h
new file mode 100644
index 000000000..18d49dd0f
--- /dev/null
+++ b/include/modules/nickserv/set_misc.h
@@ -0,0 +1,25 @@
+/*
+ * (C) 2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ */
+
+class NSMiscData : public Serialize::Object
+{
+ protected:
+ using Serialize::Object::Object;
+
+ public:
+ virtual NickServ::Account *GetAccount() anope_abstract;
+ virtual void SetAccount(NickServ::Account *) anope_abstract;
+
+ virtual Anope::string GetName() anope_abstract;
+ virtual void SetName(const Anope::string &) anope_abstract;
+
+ virtual Anope::string GetData() anope_abstract;
+ virtual void SetData(const Anope::string &) anope_abstract;
+};
+
+static Serialize::TypeReference<NSMiscData> nsmiscdata("NSMiscData");
+
diff --git a/include/modules/nickserv/suspend.h b/include/modules/nickserv/suspend.h
new file mode 100644
index 000000000..fcfc0265d
--- /dev/null
+++ b/include/modules/nickserv/suspend.h
@@ -0,0 +1,53 @@
+/*
+ * (C) 2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ */
+
+class NSSuspendInfo : public Serialize::Object
+{
+ protected:
+ using Serialize::Object::Object;
+
+ public:
+ virtual NickServ::Account *GetAccount() anope_abstract;
+ virtual void SetAccount(NickServ::Account *) anope_abstract;
+
+ virtual Anope::string GetBy() anope_abstract;
+ virtual void SetBy(const Anope::string &) anope_abstract;
+
+ virtual Anope::string GetReason() anope_abstract;
+ virtual void SetReason(const Anope::string &) anope_abstract;
+
+ virtual time_t GetWhen() anope_abstract;
+ virtual void SetWhen(const time_t &) anope_abstract;
+
+ virtual time_t GetExpires() anope_abstract;
+ virtual void SetExpires(const time_t &) anope_abstract;
+};
+
+static Serialize::TypeReference<NSSuspendInfo> nssuspendinfo("NSSuspendInfo");
+
+namespace Event
+{
+ struct CoreExport NickSuspend : Events
+ {
+ /** Called when a nick is suspended
+ * @param na The nick alias
+ */
+ virtual void OnNickSuspend(NickServ::Nick *na) anope_abstract;
+ };
+
+ struct CoreExport NickUnsuspend : Events
+ {
+ /** Called when a nick is unsuspneded
+ * @param na The nick alias
+ */
+ virtual void OnNickUnsuspend(NickServ::Nick *na) anope_abstract;
+ };
+}
+
+template<> struct EventName<Event::NickSuspend> { static constexpr const char *const name = "OnNickSuspend"; };
+template<> struct EventName<Event::NickUnsuspend> { static constexpr const char *const name = "OnNickUnsuspend"; };
diff --git a/include/modules/nickserv/update.h b/include/modules/nickserv/update.h
new file mode 100644
index 000000000..ce75c33ac
--- /dev/null
+++ b/include/modules/nickserv/update.h
@@ -0,0 +1,21 @@
+/*
+ *
+ * (C) 2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ */
+
+namespace Event
+{
+ struct CoreExport NickUpdate : Events
+ {
+ /** Called when a user does /ns update
+ * @param u The user
+ */
+ virtual void OnNickUpdate(User *u) anope_abstract;
+ };
+}
+
+template<> struct EventName<Event::NickUpdate> { static constexpr const char *const name = "OnNickUpdate"; };