summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-08 17:09:07 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-05-08 17:09:07 +0000
commit5b949866d429203ae48f2088e4f97592755592c6 (patch)
treee1a8fd0b258c4798c98424bd4f578e60b81ee2fe
parentc108e40094f390070a06e0be6e2bfb704c1bb1ac (diff)
Added m_nokicks and chanmode +Q
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@796 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--docs/helpop.conf.example3
-rw-r--r--src/InspIRCd.dev12
-rw-r--r--src/InspIRCd.layout27
-rw-r--r--src/modules/m_nokicks.cpp79
4 files changed, 109 insertions, 12 deletions
diff --git a/docs/helpop.conf.example b/docs/helpop.conf.example
index d32dabd90..7f900853d 100644
--- a/docs/helpop.conf.example
+++ b/docs/helpop.conf.example
@@ -285,5 +285,6 @@
line14="p Make channel private (hide from /LIST)"
line15="s Make channel secret (can't be used at the same time as +p)"
line16="O Channel is IRCops only (can only be set by IRCops)"
- line17="t Only halfops and above can change the topic">
+ line17="t Only halfops and above can change the topic"
+ line18="Q Only U-Lined servers/nicks can kick">
diff --git a/src/InspIRCd.dev b/src/InspIRCd.dev
index 0a8a9bdbd..845b0de03 100644
--- a/src/InspIRCd.dev
+++ b/src/InspIRCd.dev
@@ -1,7 +1,7 @@
[Project]
FileName=InspIRCd.dev
Name=InspIRCd - The Inspire Internet Relay Chat Daemon
-UnitCount=54
+UnitCount=55
Type=1
Ver=1
ObjFiles=
@@ -585,3 +585,13 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
+[Unit55]
+FileName=modules\m_nokicks.cpp
+CompileCpp=1
+Folder=Modules/Server
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
diff --git a/src/InspIRCd.layout b/src/InspIRCd.layout
index 47f8b945b..08ae870b7 100644
--- a/src/InspIRCd.layout
+++ b/src/InspIRCd.layout
@@ -13,9 +13,9 @@ LeftChar=1
[Editor_1]
Open=1
Top=0
-CursorCol=40
-CursorRow=962
-TopLine=932
+CursorCol=1
+CursorRow=1
+TopLine=1
LeftChar=1
[Editor_2]
@@ -164,7 +164,7 @@ LeftChar=1
[Editor_20]
Open=1
-Top=1
+Top=0
CursorCol=25
CursorRow=380
TopLine=332
@@ -380,22 +380,22 @@ LeftChar=1
Open=1
Top=0
CursorCol=1
-CursorRow=192
+CursorRow=211
TopLine=179
LeftChar=1
[Editor_51]
Open=1
Top=0
-CursorCol=4
-CursorRow=78
-TopLine=52
+CursorCol=12
+CursorRow=57
+TopLine=28
LeftChar=1
[Editor_52]
Open=1
Top=0
CursorCol=2
-CursorRow=62
-TopLine=16
+CursorRow=39
+TopLine=4
LeftChar=1
[Editor_53]
Open=1
@@ -404,3 +404,10 @@ CursorCol=17
CursorRow=28
TopLine=10
LeftChar=1
+[Editor_54]
+Open=1
+Top=1
+CursorCol=50
+CursorRow=20
+TopLine=14
+LeftChar=1
diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp
new file mode 100644
index 000000000..07b26d8e7
--- /dev/null
+++ b/src/modules/m_nokicks.cpp
@@ -0,0 +1,79 @@
+#include <stdio.h>
+
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+
+/* $ModDesc: Provides support for unreal-style channel mode +Q */
+
+class ModuleNoKicks : public Module
+{
+ Server *Srv;
+ bool NoisyNoKicks;
+ ConfigReader *Conf;
+
+ public:
+
+ ModuleNoKicks()
+ {
+ Srv = new Server;
+ Srv->AddExtendedMode('Q',MT_CHANNEL,false,0,0);
+ }
+
+ virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type)
+ {
+ if (access_type == AC_KICK)
+ {
+ if (channel->IsCustomModeSet('Q'))
+ {
+ if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,"")))
+ {
+ // ulines can still kick with +Q in place
+ return ACR_ALLOW;
+ }
+ else
+ {
+ // nobody else can (not even opers with override, and founders)
+ return ACR_DENY;
+ }
+ }
+ }
+ return ACR_DEFAULT;
+ }
+
+ virtual ~ModuleNoKicks()
+ {
+ delete Srv;
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version(1,0,0,0);
+ }
+};
+
+
+class ModuleNoKicksFactory : public ModuleFactory
+{
+ public:
+ ModuleNoKicksFactory()
+ {
+ }
+
+ ~ModuleNoKicksFactory()
+ {
+ }
+
+ virtual Module * CreateModule()
+ {
+ return new ModuleNoKicks;
+ }
+
+};
+
+
+extern "C" void * init_module( void )
+{
+ return new ModuleNoKicksFactory;
+}
+