aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar w00t2008-01-11 21:57:52 +0000
committerGravatar w00t2008-01-11 21:57:52 +0000
commit7a320a00dfd5f69dedda1e8697ced03cebb71717 (patch)
tree38a01019e10243cae7b42f207fec644edc2349ae
parentHeader update: 2007 -> 2008 (diff)
Backport <goodchan>: Explicitly allow channels denied by <badchan>
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8698 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--docs/inspircd.conf.example9
-rw-r--r--src/modules/m_denychans.cpp10
2 files changed, 17 insertions, 2 deletions
diff --git a/docs/inspircd.conf.example b/docs/inspircd.conf.example
index 45dc01add..457572a76 100644
--- a/docs/inspircd.conf.example
+++ b/docs/inspircd.conf.example
@@ -1478,13 +1478,18 @@
# If you have the m_denychans.so module loaded, you need to specify #
# the channels to deny: #
# #
-# name - The channel name to deny. #
+# name - The channel name to deny. (glob masks are ok) #
# #
# allowopers - If operators are allowed to override the deny. #
# #
# reason - Reason given for the deny. #
# #
-#<badchan name="#gods" allowopers="yes" reason="Tortoises!">
+#<badchan name="#gods*" allowopers="yes" reason="Tortoises!"> #
+# #
+# Additionally, you may specify channels which are allowed, even if #
+# a badchan tag specifies it would be denied: #
+#<goodchan name="#godsleeps"> #
+# Glob masks are accepted here also.
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Devoice Module: Let users devoice themselves.
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index 738a58103..371c58cac 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -68,11 +68,21 @@ class ModuleDenyChannels : public Module
else
{
std::string reason = Conf->ReadValue("badchan","reason",j);
+
+ for (int j = 0; j < Conf->Enumerate("goodchan"); j++)
+ {
+ if (match(cname, Conf->ReadValue("goodchan", "name", j).c_str()))
+ {
+ return 0;
+ }
+ }
+
user->WriteServ("926 %s %s :Channel %s is forbidden: %s",user->nick,cname,cname,reason.c_str());
return 1;
}
}
}
+
return 0;
}
};