From ce4c050657398c6eabddee651aa3f432ffe22574 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 8 Aug 2006 14:40:53 +0000 Subject: AddWhoWas(userrec) -> userrec::AddToWhoWas() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4790 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 8a48a641c..aab7815e8 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -698,7 +698,7 @@ void userrec::QuitUser(userrec *user,const std::string &quitreason) { if (IS_LOCAL(user)) WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason.c_str()); - AddWhoWas(user); + user->AddToWhoWas(); } if (iter != clientlist.end()) @@ -737,29 +737,29 @@ WhoWasGroup::~WhoWasGroup() } /* adds or updates an entry in the whowas list */ -void AddWhoWas(userrec* u) +void userrec::AddToWhoWas() { - whowas_users::iterator iter = whowas.find(u->nick); - + whowas_users::iterator iter = whowas.find(this->nick); + if (iter == whowas.end()) { whowas_set* n = new whowas_set; - WhoWasGroup *a = new WhoWasGroup(u); + WhoWasGroup *a = new WhoWasGroup(this); n->push_back(a); - whowas[u->nick] = n; + whowas[this->nick] = n; } else { whowas_set* group = (whowas_set*)iter->second; - + if (group->size() > 10) { WhoWasGroup *a = (WhoWasGroup*)*(group->begin()); DELETE(a); group->pop_front(); } - - WhoWasGroup *a = new WhoWasGroup(u); + + WhoWasGroup *a = new WhoWasGroup(this); group->push_back(a); } } -- cgit v1.2.3