diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-11-02 04:28:23 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-11-02 04:28:23 +0000 |
commit | 7901c49c541860a6c120b9220bf6196e4d3672f7 (patch) | |
tree | c4c7d85b4642b851a457796418a4b7400d1e8c8b /src/modules | |
parent | de184f9d627d26efebd2da1756b8d1d20656b6ad (diff) |
Fix incorrect watch usage, patch from dz (thanks).
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10791 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_watch.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 71e651736..fd48f7f04 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -162,7 +162,7 @@ class CommandWatch : public Command wl->erase(n); } - if (!wl->size()) + if (wl->empty()) { user->Shrink("watchlist"); delete wl; @@ -177,7 +177,8 @@ class CommandWatch : public Command /* I'm no longer watching you... */ x->second.erase(n2); - if (!x->second.size()) + if (x->second.empty()) + /* nobody else is, either. */ whos_watching_me->erase(nick); } } @@ -263,7 +264,7 @@ class CommandWatch : public Command CmdResult Handle (const std::vector<std::string> ¶meters, User *user) { - if (!parameters.size()) + if (parameters.empty()) { watchlist* wl; if (user->GetExt("watchlist", wl)) @@ -298,8 +299,9 @@ class CommandWatch : public Command /* I'm no longer watching you... */ i2->second.erase(n); - if (!i2->second.size()) - whos_watching_me->erase(user->nick.c_str()); + if (i2->second.empty()) + /* nobody else is, either. */ + whos_watching_me->erase(i2); } } @@ -458,8 +460,9 @@ class Modulewatch : public Module /* I'm no longer watching you... */ i2->second.erase(n); - if (!i2->second.size()) - whos_watching_me->erase(user->nick.c_str()); + if (i2->second.empty()) + /* and nobody else is, either. */ + whos_watching_me->erase(i2); } } |