summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/operserv.h2
-rw-r--r--modules/core/os_sqline.cpp5
-rw-r--r--src/operserv.cpp5
3 files changed, 7 insertions, 5 deletions
diff --git a/include/operserv.h b/include/operserv.h
index 8bac11e76..20d24ae5d 100644
--- a/include/operserv.h
+++ b/include/operserv.h
@@ -142,11 +142,13 @@ class CoreExport XLineManager
*/
virtual XLine *Add(BotInfo *bi, User *u, const Anope::string &mask, time_t expires, const Anope::string &reason);
+ private:
/** Delete an XLine, eg, remove it from the IRCd.
* @param x The xline
*/
virtual void Del(XLine *x);
+ public:
/** Checks if a mask can/should be added to the XLineManager
* @param mask The mask
* @param expires When the mask would expire
diff --git a/modules/core/os_sqline.cpp b/modules/core/os_sqline.cpp
index 5688351e9..3a49099cc 100644
--- a/modules/core/os_sqline.cpp
+++ b/modules/core/os_sqline.cpp
@@ -170,12 +170,9 @@ class CommandOSSQLine : public Command
reason += " " + params[3];
if (!mask.empty() && !reason.empty())
{
- User *user = finduser(mask);
- if (user)
- mask = "*@" + user->host;
unsigned int affected = 0;
for (patricia_tree<User *>::const_iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; ++it)
- if (Anope::Match((*it)->GetIdent() + "@" + (*it)->host, mask))
+ if (Anope::Match((*it)->nick, mask))
++affected;
float percent = static_cast<float>(affected) / static_cast<float>(UserListByNick.size()) * 100.0;
diff --git a/src/operserv.cpp b/src/operserv.cpp
index 46b09980d..c76b34375 100644
--- a/src/operserv.cpp
+++ b/src/operserv.cpp
@@ -297,6 +297,8 @@ bool XLineManager::DelXLine(XLine *x)
if (it != this->XLines.end())
{
+ this->Del(x);
+
delete x;
this->XLines.erase(it);
@@ -427,7 +429,8 @@ XLine *XLineManager::Check(User *u)
if (x->Expires && x->Expires < Anope::CurTime)
{
- OnExpire(x);
+ this->OnExpire(x);
+ this->Del(x);
delete x;
this->XLines.erase(XLines.begin() + i - 1);
continue;