diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-24 04:01:45 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-24 04:01:45 +0000 |
commit | 7f6344e3addae201daa77fab7d93c2908e19f441 (patch) | |
tree | a60845513b65496b935d2352ffa27a03a3b1313e | |
parent | 397a77259a21f730c8fe06d2df65ecf51119549c (diff) |
Fix a bug in whowas that could desync list.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6091 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/users.h | 2 | ||||
-rw-r--r-- | src/users.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/users.h b/include/users.h index 80fbf43e0..d24a93fca 100644 --- a/include/users.h +++ b/include/users.h @@ -880,7 +880,7 @@ namespace irc /** Sets of time and users in whowas list */ - typedef std::map<time_t,irc::string> whowas_users_fifo; + typedef std::deque<std::pair<time_t,irc::string> > whowas_users_fifo; /** Called every hour by the core to remove expired entries */ diff --git a/src/users.cpp b/src/users.cpp index c8f5bf927..44947fa6c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -947,12 +947,12 @@ void userrec::AddToWhoWas() irc::whowas::WhoWasGroup *a = new irc::whowas::WhoWasGroup(this); n->push_back(a); ServerInstance->whowas[this->nick] = n; - ServerInstance->whowas_fifo[ServerInstance->Time()] = this->nick; + ServerInstance->whowas_fifo.push_back(std::make_pair(ServerInstance->Time(),this->nick)); if ((int)(ServerInstance->whowas.size()) > ServerInstance->Config->WhoWasMaxGroups) { ServerInstance->Log(DEBUG,"Maxgroups of %d reached deleting oldest group '%s'",ServerInstance->Config->WhoWasMaxGroups, ServerInstance->whowas_fifo.begin()->second.c_str()); ServerInstance->whowas.erase(ServerInstance->whowas_fifo.begin()->second); - ServerInstance->whowas_fifo.erase(ServerInstance->whowas_fifo.begin()); + ServerInstance->whowas_fifo.pop_front(); } } else |