From 9e42a8e8f77b3c9fa65d7d2384b3d145f46e1376 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 20 Oct 2014 15:14:54 -0400 Subject: Fix m_banredirect causing bans added for hosts being rewritten as nicks --- src/modules/m_banredirect.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/modules') 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(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()) -- cgit v1.2.3