summaryrefslogtreecommitdiff
path: root/src/modules/m_noinvite.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-21 16:36:20 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-07-21 16:36:20 +0000
commit3e0c1531322d8997a7f912ac1e70c4093414f3f9 (patch)
treea96ceb73d9ce922c1034f9d43566cdda91e3d8a9 /src/modules/m_noinvite.cpp
parente97cce71bbc3f4ce46a01fd3e32375a7ef8611d7 (diff)
Add CHANOPS_EXEMPT support to m_noinvite, also add +b V: extban
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10060 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_noinvite.cpp')
-rw-r--r--src/modules/m_noinvite.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp
index d4e38bd86..53e5ca84f 100644
--- a/src/modules/m_noinvite.cpp
+++ b/src/modules/m_noinvite.cpp
@@ -31,16 +31,25 @@ class ModuleNoInvite : public Module
ni = new NoInvite(ServerInstance);
if (!ServerInstance->Modes->AddMode(ni))
throw ModuleException("Could not add new modes!");
- Implementation eventlist[] = { I_OnUserPreInvite };
- ServerInstance->Modules->Attach(eventlist, this, 1);
+ Implementation eventlist[] = { I_OnUserPreInvite, I_On005Numeric };
+ ServerInstance->Modules->Attach(eventlist, this, 2);
}
+ virtual void On005Numeric(std::string &output)
+ {
+ ServerInstance->AddExtBanChar('V');
+ }
virtual int OnUserPreInvite(User* user,User* dest,Channel* channel, time_t timeout)
{
if (IS_LOCAL(user))
{
- if (channel->IsModeSet('V'))
+ if (CHANOPS_EXEMPT(ServerInstance, 'c') && channel->GetStatus(user) == STATUS_OP)
+ {
+ return 0;
+ }
+
+ if (channel->IsModeSet('V') || channel->IsExtBanned(user, 'V'))
{
user->WriteNumeric(ERR_NOCTCPALLOWED, "%s %s :Can't invite %s to channel (+V set)",user->nick.c_str(), channel->name.c_str(), dest->nick.c_str());
return 1;