From 085f7e07d460a2fef17a507f0cc0f9ccd4561724 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 22 May 2004 14:24:29 +0000 Subject: Added OnUserPreInvite method for use with +V etc git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@817 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/modules.h | 7 +++++++ src/modules.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/include/modules.h b/include/modules.h index 698060681..978a9a4a6 100644 --- a/include/modules.h +++ b/include/modules.h @@ -248,6 +248,13 @@ class Module : public classbase */ virtual void OnWhois(userrec* source, userrec* dest); + /** Called whenever a user is about to invite another user into a channel, before any processing is done. + * Returning any nonzero value from this function stops the process immediately, causing no + * output to be sent to the user by the core. If you do this you must produce your own numerics, + * notices etc. This is useful for modules which may want to filter invites to channels. + */ + virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel); + /** Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. * Returning any nonzero value from this function stops the process immediately, causing no * output to be sent to the user by the core. If you do this you must produce your own numerics, diff --git a/src/modules.cpp b/src/modules.cpp index d4f98cc86..a2f8a4413 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -310,6 +310,7 @@ Version Module::GetVersion() { return Version(1,0,0,0); } void Module::OnOper(userrec* user) { }; void Module::OnInfo(userrec* user) { }; void Module::OnWhois(userrec* source, userrec* dest) { }; +int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0 }; int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text) { return 0; }; int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text) { return 0; }; int Module::OnUserPreNick(userrec* user, std::string newnick) { return 0; }; -- cgit v1.2.3