* | 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
* 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
{
/* Yup, is on my list */
watchlist::iterator n = wl->find(nick);
+
+ if (!wl)
+ return CMD_FAILURE;
+
if (n != wl->end())
{
if (!n->second.empty())
whos_watching_me = new watchentries();
mycommand = new CommandWatch(ServerInstance, maxwatch);
ServerInstance->AddCommand(mycommand);
+ Implementation eventlist[] = { I_OnRehash, I_OnGarbageCollect, I_OnCleanup, I_OnUserQuit, I_OnPostConnect, I_OnUserPostNick, I_On005Numeric };
+ ServerInstance->Modules->Attach(eventlist, this, 7);
}
virtual void OnRehash(User* user, const std::string ¶meter)
maxwatch = 32;
}
- void Implements(char* List)
- {
- List[I_OnRehash] = List[I_OnGarbageCollect] = List[I_OnCleanup] = List[I_OnUserQuit] = List[I_OnPostConnect] = List[I_OnUserPostNick] = List[I_On005Numeric] = 1;
- }
virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
{
/* User's quitting, we're done with this. */
delete wl;
+ user->Shrink("watchlist");
}
}