diff options
Diffstat (limited to 'linden/indra/newview/llgroupmgr.cpp')
-rw-r--r-- | linden/indra/newview/llgroupmgr.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/linden/indra/newview/llgroupmgr.cpp b/linden/indra/newview/llgroupmgr.cpp index 30b7cbd..1a04ae5 100644 --- a/linden/indra/newview/llgroupmgr.cpp +++ b/linden/indra/newview/llgroupmgr.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2004&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2004&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2004-2008, Linden Research, Inc. | 7 | * Copyright (c) 2004-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -52,6 +52,7 @@ | |||
52 | #include "llfloaterdirectory.h" | 52 | #include "llfloaterdirectory.h" |
53 | #include "llfloatergroupinfo.h" | 53 | #include "llfloatergroupinfo.h" |
54 | #include "lluictrlfactory.h" | 54 | #include "lluictrlfactory.h" |
55 | #include <boost/regex.hpp> | ||
55 | 56 | ||
56 | 57 | ||
57 | const U32 MAX_CACHED_GROUPS = 10; | 58 | const U32 MAX_CACHED_GROUPS = 10; |
@@ -791,6 +792,20 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) | |||
791 | return NULL; | 792 | return NULL; |
792 | } | 793 | } |
793 | 794 | ||
795 | // Helper function for LLGroupMgr::processGroupMembersReply | ||
796 | // This reformats date strings from MM/DD/YYYY to YYYY/MM/DD ( e.g. 1/27/2008 -> 2008/1/27 ) | ||
797 | // so that the sorter can sort by year before month before day. | ||
798 | static void formatDateString(std::string &date_string) | ||
799 | { | ||
800 | using namespace boost; | ||
801 | cmatch result; | ||
802 | const regex expression("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})"); | ||
803 | if (regex_match(date_string.c_str(), result, expression)) | ||
804 | { | ||
805 | date_string = result[3]+"/"+result[1]+"/"+result[2]; | ||
806 | } | ||
807 | } | ||
808 | |||
794 | // static | 809 | // static |
795 | void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) | 810 | void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) |
796 | { | 811 | { |
@@ -840,6 +855,8 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) | |||
840 | 855 | ||
841 | if (member_id.notNull()) | 856 | if (member_id.notNull()) |
842 | { | 857 | { |
858 | formatDateString(online_status); // reformat for sorting, e.g. 12/25/2008 -> 2008/12/25 | ||
859 | |||
843 | //llinfos << "Member " << member_id << " has powers " << std::hex << agent_powers << std::dec << llendl; | 860 | //llinfos << "Member " << member_id << " has powers " << std::hex << agent_powers << std::dec << llendl; |
844 | LLGroupMemberData* newdata = new LLGroupMemberData(member_id, | 861 | LLGroupMemberData* newdata = new LLGroupMemberData(member_id, |
845 | contribution, | 862 | contribution, |