diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-02 10:35:42 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-10-02 10:35:42 -0700 |
commit | 4d53e235c2445b820bb0ae7303b269648dd86037 (patch) | |
tree | c1ab3643cf257099822e7a0e1e832d76813555f6 /indra/newview/llrecentpeople.cpp | |
parent | 80f27013b2d2a7ca6509db033c8f0c31562e04c7 (diff) | |
parent | dde2153014cd7d7b8fa704f7067a41344bfbb1c2 (diff) |
merge of latest viewer/viewer-20
Diffstat (limited to 'indra/newview/llrecentpeople.cpp')
-rw-r--r-- | indra/newview/llrecentpeople.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp index 04abe36878..b491c7e109 100644 --- a/indra/newview/llrecentpeople.cpp +++ b/indra/newview/llrecentpeople.cpp @@ -40,27 +40,38 @@ using namespace LLOldEvents; bool LLRecentPeople::add(const LLUUID& id) { - if (contains(id) || id == gAgent.getID()) + if (id == gAgent.getID()) return false; LLDate date_added = LLDate::now(); - mList.insert(std::make_pair(id, date_added)); + + //[] instead of insert to replace existing id->date with new date value + mPeople[id] = date_added; mChangedSignal(); return true; } bool LLRecentPeople::contains(const LLUUID& id) const { - return mList.find(id) != mList.end(); + return mPeople.find(id) != mPeople.end(); } void LLRecentPeople::get(std::vector<LLUUID>& result) const { result.clear(); - for (recent_people_t::const_iterator pos = mList.begin(); pos != mList.end(); ++pos) + for (recent_people_t::const_iterator pos = mPeople.begin(); pos != mPeople.end(); ++pos) result.push_back((*pos).first); } +const LLDate& LLRecentPeople::getDate(const LLUUID& id) const +{ + recent_people_t::const_iterator it = mPeople.find(id); + if (it!= mPeople.end()) return (*it).second; + + static LLDate no_date = LLDate(); + return no_date; +} + // virtual bool LLRecentPeople::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { |