From 7f6344e3addae201daa77fab7d93c2908e19f441 Mon Sep 17 00:00:00 2001 From: peavey Date: Sun, 24 Dec 2006 04:01:45 +0000 Subject: 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 --- include/users.h | 2 +- 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 whowas_users_fifo; + typedef std::deque > 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 -- cgit v1.2.3