]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_watch.cpp
Add comments
[user/henk/code/inspircd.git] / src / modules / m_watch.cpp
index 4ce4d0340bfbb7a345413c8e002bb6d6a92f7057..669f76b538d8f2d5a0e993128c99c72097af214f 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -62,7 +62,7 @@
  * Yes, it's horrid. Blame cl for being different. -- w00t
  */
 #ifdef WINDOWS
-typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, less<irc::string> > > watchentries;
+typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, std::less<irc::string> > > watchentries;
 #else
 typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash<irc::string> > watchentries;
 #endif
@@ -94,6 +94,10 @@ class CommandWatch : public Command
                {
                        /* Yup, is on my list */
                        watchlist::iterator n = wl->find(nick);
+
+                       if (!wl)
+                               return CMD_FAILURE;
+
                        if (n != wl->end())
                        {
                                if (!n->second.empty())
@@ -365,6 +369,7 @@ class Modulewatch : public Module
 
                        /* User's quitting, we're done with this. */
                        delete wl;
+                       user->Shrink("watchlist");
                }
        }