summaryrefslogtreecommitdiff
path: root/include/modules/nickserv.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
committerAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
commit26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch)
treeb9916f14fe35ce5c4de95c4194ca4ea0cb30812f /include/modules/nickserv.h
parent0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff)
New event system
Diffstat (limited to 'include/modules/nickserv.h')
-rw-r--r--include/modules/nickserv.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/include/modules/nickserv.h b/include/modules/nickserv.h
new file mode 100644
index 000000000..0ede4130e
--- /dev/null
+++ b/include/modules/nickserv.h
@@ -0,0 +1,68 @@
+/*
+ *
+ * (C) 2014 Anope Team
+ * Contact us at team@anope.org
+ *
+ * Please read COPYING and README for further details.
+ *
+ */
+
+namespace NickServ
+{
+ class NickServService : public Service
+ {
+ public:
+ NickServService(Module *m) : Service(m, "NickServService", "NickServ")
+ {
+ }
+
+ virtual void Validate(User *u) anope_abstract;
+ virtual void Collide(User *u, NickAlias *na) anope_abstract;
+ virtual void Release(NickAlias *na) anope_abstract;
+ };
+ static ServiceReference<NickServService> service("NickServService", "NickServ");
+
+ namespace Event
+ {
+ struct CoreExport PreNickExpire : Events
+ {
+ /** Called before a nick expires
+ * @param na The nick
+ * @param expire Set to true to allow the nick to expire
+ */
+ virtual void OnPreNickExpire(NickAlias *na, bool &expire) anope_abstract;
+ };
+ static EventHandlersReference<PreNickExpire> OnPreNickExpire("OnPreNickExpire");
+
+ struct CoreExport NickExpire : Events
+ {
+ /** Called when a nick drops
+ * @param na The nick
+ */
+ virtual void OnNickExpire(NickAlias *na) anope_abstract;
+ };
+ static EventHandlersReference<NickExpire> OnNickExpire("OnNickExpire");
+
+ struct CoreExport NickRegister : Events
+ {
+ /** Called when a nick is registered
+ * @param user The user registering the nick, of any
+ * @param The nick
+ */
+ virtual void OnNickRegister(User *user, NickAlias *na) anope_abstract;
+ };
+ static EventHandlersReference<NickRegister> OnNickRegister("OnNickRegister");
+
+ struct CoreExport NickValidate : Events
+ {
+ /** 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) anope_abstract;
+ };
+ static EventHandlersReference<NickValidate> OnNickValidate("OnNickValidate");
+ }
+}