From 784f0cb54f8f2f8aa31acdbef824ed7ddbd05f1e Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 23 Jan 2010 15:59:52 +0000 Subject: 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 --- src/modules/m_services_account.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/modules') 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); -- cgit v1.3.1-10-gc9f91