aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar danieldg2010-01-23 15:59:52 +0000
committerGravatar danieldg2010-01-23 15:59:52 +0000
commit784f0cb54f8f2f8aa31acdbef824ed7ddbd05f1e (patch)
tree1c7a6ae645772c55ecdc5d65727c9036e3207fb3 /src/modules
parentFall back to copying bind IP if getsockname() fails, as it apparently can on ... (diff)
Support account invex extbans (+I R:accountname) [patch by Johannes13]
git-svn-id: http://svn.inspircd.org/repository/branches/1_2_stable@12315 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_services_account.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 7aebaa1b9..5f76582ce 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -13,6 +13,7 @@
#include "inspircd.h"
#include "account.h"
+#include "u_listmode.h"
/* $ModDesc: Povides support for ircu-style services accounts, including chmode +R, etc. */
@@ -117,9 +118,9 @@ class ModuleServicesAccount : public Module
throw ModuleException("Some other module has claimed our modes!");
Implementation eventlist[] = { I_OnWhois, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreJoin, I_OnCheckBan,
- I_OnSyncUserMetaData, I_OnUserQuit, I_OnCleanup, I_OnDecodeMetaData, I_On005Numeric, I_OnUserPostNick };
+ I_OnSyncUserMetaData, I_OnUserQuit, I_OnCleanup, I_OnDecodeMetaData, I_On005Numeric, I_OnCheckInvite, I_OnUserPostNick };
- ServerInstance->Modules->Attach(eventlist, this, 10);
+ ServerInstance->Modules->Attach(eventlist, this, 11);
}
virtual void On005Numeric(std::string &t)
@@ -216,6 +217,25 @@ class ModuleServicesAccount : public Module
return chan->GetExtBanStatus(*account, 'R');
}
+ virtual int OnCheckInvite(User *user, Channel *c)
+ {
+ std::string* account;
+ if (!IS_LOCAL(user) || !user->GetExt("accountname", account))
+ return 0;
+
+ Module* ExceptionModule = ServerInstance->Modules->Find("m_inviteexception.so");
+ if (ExceptionModule)
+ {
+ if (ListModeRequest(this, ExceptionModule, *account, 'R', c).Send())
+ {
+ // account name is exempt
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
virtual int OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
return OnUserPreMessage(user, dest, target_type, text, status, exempt_list);