- SVSHold* res = new SVSHold();
- int set_on;
- irc::tokenstream tokens(data);
- tokens.GetToken(res->nickname);
- tokens.GetToken(res->set_by);
- tokens.GetToken(set_on);
- res->set_on = set_on;
- tokens.GetToken(res->length);
- tokens.GetToken(res->reason);
- return res;
- }
-
- void ExpireBans()
- {
- SVSHoldlist::iterator iter,safeiter;
- for (iter = SVSHolds.begin(); iter != SVSHolds.end(); iter++)
- {
- /* 0 == permanent, don't mess with them! -- w00t */
- if ((*iter)->length != 0)
- {
- if ((*iter)->set_on + (*iter)->length <= ServerInstance->Time())
- {
- ServerInstance->Log(DEBUG, "m_svshold.so: hold on %s expired, removing...", (*iter)->nickname.c_str());
- ServerInstance->WriteOpers("*** %li second SVSHOLD on %s (%s) set %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on);
- HoldMap.erase(assign((*iter)->nickname));
- delete *iter;
- safeiter = iter;
- --iter;
- SVSHolds.erase(safeiter);
- }
- }
- }