1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 #include "cull_list.h"
19 * In current implementation of CullList, this isn't used. It did odd things with a lot of sockets.
21 bool CullList::IsValid(userrec* user)
24 std::map<userrec*,time_t>::iterator es = exempt.find(user);
25 if (es != exempt.end())
28 for (user_hash::iterator u = ServerInstance->clientlist->begin(); u != ServerInstance->clientlist->end(); u++)
30 if (user == u->second)
31 return (u->second->signon == esignon);
36 CullItem::CullItem(userrec* u, std::string &r)
42 CullItem::CullItem(userrec* u, const char* r)
52 userrec* CullItem::GetUser()
57 std::string& CullItem::GetReason()
62 CullList::CullList(InspIRCd* Instance) : ServerInstance(Instance)
68 void CullList::AddItem(userrec* user, std::string &reason)
70 if (exempt.find(user) == exempt.end())
72 CullItem item(user,reason);
74 exempt[user] = user->signon;
78 void CullList::AddItem(userrec* user, const char* reason)
80 if (exempt.find(user) == exempt.end())
82 CullItem item(user,reason);
84 exempt[user] = user->signon;
93 std::vector<CullItem>::iterator a = list.begin();
95 userrec::QuitUser(ServerInstance, a->GetUser(), a->GetReason().c_str());
96 list.erase(list.begin());