summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-14 03:17:04 -0400
committerAdam <Adam@anope.org>2013-09-27 18:02:26 -0400
commit1107b92699407f80fcfa9e12a491468d6f57b1d9 (patch)
tree4ff0ccfcefa6e0fe87802de4797cde0761f37f57 /modules
parent3b0b1bc80e6161d5cdf85f792174f31ead178b93 (diff)
Drop matching channels on forbid, and enforce nick forbids even on IRCds
with no qlines
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/os_forbid.cpp29
-rw-r--r--modules/pseudoclients/operserv.cpp6
2 files changed, 33 insertions, 2 deletions
diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp
index 866b2248a..0099348b0 100644
--- a/modules/commands/os_forbid.cpp
+++ b/modules/commands/os_forbid.cpp
@@ -126,6 +126,12 @@ class CommandOSForbid : public Command
reason += params[4];
reason.trim();
+ if (entry.replace_all_cs("?*", "").empty())
+ {
+ source.Reply(_("The mask must contain at least one non wildcard character."));
+ return;
+ }
+
time_t expiryt = 0;
if (!expiry.empty())
@@ -170,6 +176,9 @@ class CommandOSForbid : public Command
module->OnUserNickChange(it->second, "");
break;
case FT_CHAN:
+ {
+ int chan_matches = 0, ci_matches = 0;
+
for (channel_map::const_iterator it = ChannelList.begin(), it_end = ChannelList.end(); it != it_end;)
{
Channel *c = it->second;
@@ -192,6 +201,8 @@ class CommandOSForbid : public Command
chanserv->Hold(c);
}
+ ++chan_matches;
+
for (Channel::ChanUserList::const_iterator cit = c->users.begin(), cit_end = c->users.end(); cit != cit_end;)
{
User *u = cit->first;
@@ -208,7 +219,25 @@ class CommandOSForbid : public Command
c->Kick(source.service, u, "%s", reason.c_str());
}
}
+
+ for (registered_channel_map::const_iterator it = RegisteredChannelList->begin(); it != RegisteredChannelList->end();)
+ {
+ ChannelInfo *ci = it->second;
+ ++it;
+
+ d = this->fs->FindForbid(ci->name, FT_CHAN);
+ if (d == NULL)
+ continue;
+
+ ++ci_matches;
+
+ delete ci;
+ }
+
+ source.Reply(_("\2%d\2 channels cleared, and \2%d\2 channels dropped."), chan_matches, ci_matches);
+
break;
+ }
default:
break;
}
diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp
index ddd585841..cdc74c470 100644
--- a/modules/pseudoclients/operserv.cpp
+++ b/modules/pseudoclients/operserv.cpp
@@ -68,8 +68,10 @@ class SGLineManager : public XLineManager
class SQLineManager : public XLineManager
{
+ ServiceReference<NickServService> nickserv;
+
public:
- SQLineManager(Module *creator) : XLineManager(creator, "xlinemanager/sqline", 'Q') { }
+ SQLineManager(Module *creator) : XLineManager(creator, "xlinemanager/sqline", 'Q'), nickserv("NickServService", "NickServ") { }
void OnMatch(User *u, XLine *x) anope_override
{
@@ -248,7 +250,7 @@ class OperServCore : public Module
void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override
{
- if (IRCD->CanSQLine && !u->HasMode("OPER"))
+ if (!u->HasMode("OPER"))
this->sqlines.CheckAllXLines(u);
}