summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-10-20 15:14:54 -0400
committerAdam <Adam@anope.org>2014-10-23 00:06:49 -0400
commit9e42a8e8f77b3c9fa65d7d2384b3d145f46e1376 (patch)
treef82fd278f2f853817f2c164e245fd41fc88ed96f /src
parent7571d61a328b3ea75a307a3ff24c38cc02c8d108 (diff)
Fix m_banredirect causing bans added for hosts being rewritten as nicks
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_banredirect.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index 2e2592541..1b9e361bf 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -75,6 +75,9 @@ class BanRedirect : public ModeWatcher
if (param.length() >= 2 && param[1] == ':')
return true;
+ if (param.find('#') == std::string::npos)
+ return true;
+
if(adding && (channel->bans.size() > static_cast<unsigned>(maxbans)))
{
source->WriteNumeric(478, "%s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)", source->nick.c_str(), channel->name.c_str(), channel->name.c_str(), maxbans);
@@ -119,6 +122,14 @@ class BanRedirect : public ModeWatcher
mask[NICK].swap(mask[IDENT]);
}
+ if (!mask[NICK].empty() && mask[IDENT].empty() && mask[HOST].empty())
+ {
+ if (mask[NICK].find('.') != std::string::npos || mask[NICK].find(':') != std::string::npos)
+ {
+ mask[NICK].swap(mask[HOST]);
+ }
+ }
+
for(int i = 0; i < 3; i++)
{
if(mask[i].empty())