From e88e1022f804bd23edff73f95e5ac3cec5effcfb Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 1 Feb 2010 11:00:14 -0800 Subject: Show SLIDs in avatar picker --- indra/newview/llfloateravatarpicker.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index a0b2de85f0..50aa70478b 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -370,6 +370,19 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) getChild("Friends")->setAllowMultipleSelection(allow_multiple); } +// IDEVO +static std::string clean_name_from_avatar_picker(const std::string& first, const std::string& last) +{ + if (last.empty() || last == "Resident") + { + return first; + } + else + { + return first + " " + last; + } +} + // static void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void**) { @@ -420,7 +433,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } else { - avatar_name = first_name + " " + last_name; + avatar_name = clean_name_from_avatar_picker(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; } -- cgit v1.2.3 From c0b7c93c18783d6a426cf43265f34c86bdeceb4a Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 4 Feb 2010 20:38:40 -0800 Subject: Converted all gCacheName->getName to getFullName for SLID compatibility Also eliminated notification "ObjectGiveItemUnknownUser" because the SLURL-based name lookup will always retrieve the user name. Fixed a bug with ObjectGiveItem where the SLURL would be incorrect for a group. --- indra/newview/llfloateravatarpicker.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 50aa70478b..7a5c7c835f 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -43,6 +43,7 @@ // Linden libraries #include "llbutton.h" +#include "llcachename.h" #include "lllineeditor.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" @@ -370,19 +371,6 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) getChild("Friends")->setAllowMultipleSelection(allow_multiple); } -// IDEVO -static std::string clean_name_from_avatar_picker(const std::string& first, const std::string& last) -{ - if (last.empty() || last == "Resident") - { - return first; - } - else - { - return first + " " + last; - } -} - // static void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void**) { @@ -433,7 +421,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } else { - avatar_name = clean_name_from_avatar_picker(first_name, last_name); + avatar_name = LLCacheName::buildFullname(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; } -- cgit v1.2.3 From 42176145c9e81dd99b65f88152df50a7b3ccf834 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 8 Feb 2010 14:55:30 -0800 Subject: Converted names build from avatar object LLNameValue pairs to SLID Added temporary getDisplayName() to LLCacheName Moved temporary placeholder display names into LLCacheName Eliminated rarely used LLAgentUI::buildName in favor of buildFullName Standardized buildFullName capitalization --- indra/newview/llfloateravatarpicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 7a5c7c835f..cb549e65c8 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -421,7 +421,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } else { - avatar_name = LLCacheName::buildFullname(first_name, last_name); + avatar_name = LLCacheName::buildFullName(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; } -- cgit v1.2.3 From 67f3ed1844aabdb25abe1d52e651c076fec1eb9b Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 23 Feb 2010 16:34:02 -0800 Subject: Prototype search by SLID and display name --- indra/newview/llfloateravatarpicker.cpp | 109 ++++++++++++++++++++++++++++---- 1 file changed, 97 insertions(+), 12 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index cb549e65c8..63bced27d9 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -36,14 +36,17 @@ // Viewer includes #include "llagent.h" #include "llcallingcard.h" +#include "lldateutil.h" // IDEVO #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llviewercontrol.h" #include "llworld.h" // Linden libraries +#include "llavatarnamecache.h" // IDEVO #include "llbutton.h" #include "llcachename.h" +#include "llhttpclient.h" // IDEVO #include "lllineeditor.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" @@ -339,23 +342,55 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const return FALSE; } -void LLFloaterAvatarPicker::find() +class LLAvatarPickerResponder : public LLHTTPClient::Responder { - std::string text = childGetValue("Edit").asString(); +public: + LLUUID mQueryID; - mQueryID.generate(); + LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { } - LLMessageSystem* msg = gMessageSystem; + /*virtual*/ void result(const LLSD& content) + { + LLFloaterAvatarPicker* floater = + LLFloaterReg::findTypedInstance("avatar_picker"); + if (floater) + { + floater->processResponse(mQueryID, content); + } + } - msg->newMessage("AvatarPickerRequest"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->addUUID("QueryID", mQueryID); // not used right now - msg->nextBlock("Data"); - msg->addString("Name", text); + /*virtual*/ void error(U32 status, const std::string& reason) + { + llinfos << "JAMESDEBUG avatar picker failed " << status + << " reason " << reason << llendl; + } +}; - gAgent.sendReliableMessage(); +void LLFloaterAvatarPicker::find() +{ + std::string text = childGetValue("Edit").asString(); + + mQueryID.generate(); + // IDEVO + if (LLAvatarNameCache::useDisplayNames()) + { + std::string url = "http://pdp15.lindenlab.com:8050/my-service/agent/search/"; + url += LLURI::escape(text); + url += "/"; + LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); + } + else + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("AvatarPickerRequest"); + msg->nextBlock("AgentData"); + msg->addUUID("AgentID", gAgent.getID()); + msg->addUUID("SessionID", gAgent.getSessionID()); + msg->addUUID("QueryID", mQueryID); // not used right now + msg->nextBlock("Data"); + msg->addString("Name", text); + gAgent.sendReliableMessage(); + } getChild("SearchResults")->deleteAllItems(); getChild("SearchResults")->setCommentText(getString("searching")); @@ -427,6 +462,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } LLSD element; element["id"] = avatar_id; // value + element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = avatar_name; search_results->addElement(element); } @@ -440,6 +476,55 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* } } +void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& content) +{ + // Check for out-of-date query + if (query_id != mQueryID) return; + + LLScrollListCtrl* search_results = getChild("SearchResults"); + + if (content.size() == 0) + { + LLStringUtil::format_map_t map; + map["[TEXT]"] = childGetText("Edit"); + LLSD item; + item["id"] = LLUUID::null; + item["columns"][0]["column"] = "name"; + item["columns"][0]["value"] = getString("not_found", map); + search_results->addElement(item); + search_results->setEnabled(FALSE); + childDisable("ok_btn"); + return; + } + + // clear "Searching" label on first results + search_results->deleteAllItems(); + + LLSD item; + LLSD::array_const_iterator it = content.beginArray(); + for ( ; it != content.endArray(); ++it) + { + const LLSD& row = *it; + item["id"] = row["agent_id"]; + LLSD& columns = item["columns"]; + columns[0]["column"] = "name"; + columns[0]["value"] = row["display_name"]; + columns[1]["column"] = "slid"; + columns[1]["value"] = row["slid"]; + std::string born_on = row["born_on"].asString(); + columns[2]["column"] = "age"; + columns[2]["value"] = LLDateUtil::ageFromDateISO(born_on); + columns[3]["column"] = "profile"; + columns[3]["value"] = row["profile"]; + search_results->addElement(item); + } + + childEnable("ok_btn"); + search_results->selectFirstItem(); + onList(); + search_results->setFocus(TRUE); +} + //static void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) { -- cgit v1.2.3 From 0957fa04395453e5b336ee77af3a21215f9369ca Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 2 Mar 2010 15:14:49 -0800 Subject: Fix for not being able to pick resident in avatar picker with display names on --- indra/newview/llfloateravatarpicker.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 63bced27d9..ed458a4b02 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -520,6 +520,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& } childEnable("ok_btn"); + search_results->setEnabled(true); search_results->selectFirstItem(); onList(); search_results->setFocus(TRUE); -- cgit v1.2.3 From 6d1e44b0338dd2815f605a5ba6e6528932cf3ebc Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 20 Apr 2010 14:52:09 -0700 Subject: Avatar picker requests are routed via sim capability --- indra/newview/llfloateravatarpicker.cpp | 44 +++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index ed458a4b02..06070f876d 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -36,10 +36,12 @@ // Viewer includes #include "llagent.h" #include "llcallingcard.h" -#include "lldateutil.h" // IDEVO +#include "lldate.h" // split() +#include "lldateutil.h" // ageFromDate() #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llviewercontrol.h" +#include "llviewerregion.h" // getCapability() #include "llworld.h" // Linden libraries @@ -371,12 +373,26 @@ void LLFloaterAvatarPicker::find() std::string text = childGetValue("Edit").asString(); mQueryID.generate(); - // IDEVO - if (LLAvatarNameCache::useDisplayNames()) + + std::string url; + url.reserve(128); // avoid a memory allocation or two + + LLViewerRegion* region = gAgent.getRegion(); + url = region->getCapability("AvatarPickerSearch"); + // Prefer use of capabilities to search on both SLID and display name + // but allow display name search to be manually turned off for test + if (!url.empty() + && LLAvatarNameCache::useDisplayNames()) { - std::string url = "http://pdp15.lindenlab.com:8050/my-service/agent/search/"; + // capability urls don't end in '/', but we need one to parse + // query parameters correctly + if (url.size() > 0 && url[url.size()-1] != '/') + { + url += "/"; + } + url += "?name="; url += LLURI::escape(text); - url += "/"; + llinfos << "JAMESDEBUG picker " << url << llendl; LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); } else @@ -483,7 +499,8 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& LLScrollListCtrl* search_results = getChild("SearchResults"); - if (content.size() == 0) + LLSD agents = content["agents"]; + if (agents.size() == 0) { LLStringUtil::format_map_t map; map["[TEXT]"] = childGetText("Edit"); @@ -501,8 +518,8 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& search_results->deleteAllItems(); LLSD item; - LLSD::array_const_iterator it = content.beginArray(); - for ( ; it != content.endArray(); ++it) + LLSD::array_const_iterator it = agents.beginArray(); + for ( ; it != agents.endArray(); ++it) { const LLSD& row = *it; item["id"] = row["agent_id"]; @@ -510,12 +527,13 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& columns[0]["column"] = "name"; columns[0]["value"] = row["display_name"]; columns[1]["column"] = "slid"; - columns[1]["value"] = row["slid"]; - std::string born_on = row["born_on"].asString(); + columns[1]["value"] = row["sl_id"]; + LLDate account_created = row["account_created"].asDate(); + S32 year, month, day; + account_created.split(&year, &month, &day); + std::string age = LLDateUtil::ageFromDate(year, month, day); columns[2]["column"] = "age"; - columns[2]["value"] = LLDateUtil::ageFromDateISO(born_on); - columns[3]["column"] = "profile"; - columns[3]["value"] = row["profile"]; + columns[2]["value"] = age; search_results->addElement(item); } -- cgit v1.2.3 From 257c3ed2a3747256500f704f6e06e7631af3c08e Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 20 Apr 2010 16:06:25 -0700 Subject: LLDateUtil::ageFromDate() now takes more sensible parameters This and last reviewed with Kelly --- indra/newview/llfloateravatarpicker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 06070f876d..76567229d9 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -531,7 +531,8 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& LLDate account_created = row["account_created"].asDate(); S32 year, month, day; account_created.split(&year, &month, &day); - std::string age = LLDateUtil::ageFromDate(year, month, day); + std::string age = + LLDateUtil::ageFromDate(year, month, day, LLDate::now()); columns[2]["column"] = "age"; columns[2]["value"] = age; search_results->addElement(item); -- cgit v1.2.3 From 71ce49239adc1abec26d73ddd97cfd0c17677c2b Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 20 Apr 2010 17:05:54 -0700 Subject: Cleaned up debug spam --- indra/newview/llfloateravatarpicker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 76567229d9..db559ce13c 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -363,7 +363,7 @@ public: /*virtual*/ void error(U32 status, const std::string& reason) { - llinfos << "JAMESDEBUG avatar picker failed " << status + llinfos << "avatar picker failed " << status << " reason " << reason << llendl; } }; @@ -392,7 +392,7 @@ void LLFloaterAvatarPicker::find() } url += "?name="; url += LLURI::escape(text); - llinfos << "JAMESDEBUG picker " << url << llendl; + llinfos << "avatar picker " << url << llendl; LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); } else -- cgit v1.2.3 From 149dd3c11b07cfca6b5b7576d6568aef865cefda Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 28 Apr 2010 14:40:02 -0700 Subject: Allow avatar picker searches for < 3 characters Basically, allow any non-zero-length search. Relates to DEV-49464 --- indra/newview/llfloateravatarpicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index db559ce13c..f3b14b9b3d 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -548,7 +548,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& //static void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) { - childSetEnabled("Find", caller->getText().size() >= 3); + childSetEnabled("Find", caller->getText().size() > 0); } // virtual -- cgit v1.2.3 From 0e9faa3f0492f3ea1988377ee55c8b772d69ebed Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 7 May 2010 15:01:01 -0700 Subject: DEV-49780 Avatar picker uses new People API interface Reviewed with Callum --- indra/newview/llfloateravatarpicker.cpp | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index f3b14b9b3d..f7f01116b1 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -57,6 +57,8 @@ #include "lluictrlfactory.h" #include "message.h" +//#include "llsdserialize.h" + LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, BOOL allow_multiple, BOOL closeOnSelect) @@ -351,20 +353,26 @@ public: LLAvatarPickerResponder(const LLUUID& id) : mQueryID(id) { } - /*virtual*/ void result(const LLSD& content) + /*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content) { - LLFloaterAvatarPicker* floater = - LLFloaterReg::findTypedInstance("avatar_picker"); - if (floater) + //std::ostringstream ss; + //LLSDSerialize::toPrettyXML(content, ss); + //llinfos << ss.str() << llendl; + + if (isGoodStatus(status)) { - floater->processResponse(mQueryID, content); + LLFloaterAvatarPicker* floater = + LLFloaterReg::findTypedInstance("avatar_picker"); + if (floater) + { + floater->processResponse(mQueryID, content); + } + } + else + { + llinfos << "avatar picker failed " << status + << " reason " << reason << llendl; } - } - - /*virtual*/ void error(U32 status, const std::string& reason) - { - llinfos << "avatar picker failed " << status - << " reason " << reason << llendl; } }; @@ -390,7 +398,7 @@ void LLFloaterAvatarPicker::find() { url += "/"; } - url += "?name="; + url += "?names="; url += LLURI::escape(text); llinfos << "avatar picker " << url << llendl; LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); -- cgit v1.2.3 From 5aa8b5d37eb6824865d09af248aa9d9d518daeb9 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 11 May 2010 17:27:14 -0700 Subject: Clean up merge, dueling LLDateUtil refactoring --- indra/newview/llfloateravatarpicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index bca9282cec..e0346222c0 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -604,7 +604,7 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& S32 year, month, day; account_created.split(&year, &month, &day); std::string age = - LLDateUtil::ageFromDate(year, month, day, LLDate::now()); + LLDateUtil::ageFromDate(account_created, LLDate::now()); columns[2]["column"] = "age"; columns[2]["value"] = age; search_results->addElement(item); -- cgit v1.2.3 From 7fb941042251975919656b792fd4bfd9ebbc42d9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 25 May 2010 14:15:26 -0700 Subject: LLFloaterAvatarPicker now uses LLAvatarNames reviewed by James --- indra/newview/llfloateravatarpicker.cpp | 48 ++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index e0346222c0..836c832529 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -36,8 +36,6 @@ // Viewer includes #include "llagent.h" #include "llcallingcard.h" -#include "lldate.h" // split() -#include "lldateutil.h" // ageFromDate() #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llimview.h" // for gIMMgr @@ -61,6 +59,9 @@ //#include "llsdserialize.h" +//put it back as a member once the legacy path is out? +static std::map sAvatarNameMap; + LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback, BOOL allow_multiple, BOOL closeOnSelect) @@ -167,7 +168,7 @@ void LLFloaterAvatarPicker::onBtnFind() find(); } -static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vector& avatar_names, uuid_vec_t& avatar_ids) +static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avatar_ids, std::vector& avatar_names) { std::vector items = from->getAllSelected(); for (std::vector::iterator iter = items.begin(); iter != items.end(); ++iter) @@ -175,8 +176,8 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, std::vectorgetUUID().notNull()) { - avatar_names.push_back(item->getColumn(0)->getValue().asString()); avatar_ids.push_back(item->getUUID()); + avatar_names.push_back(sAvatarNameMap[item->getUUID()]); } } } @@ -212,10 +213,10 @@ void LLFloaterAvatarPicker::onBtnSelect() if(list) { - std::vector avatar_names; uuid_vec_t avatar_ids; - getSelectedAvatarData(list, avatar_names, avatar_ids); - mSelectionCallback(avatar_names, avatar_ids); + std::vector avatar_names; + getSelectedAvatarData(list, avatar_ids, avatar_names); + mSelectionCallback(avatar_ids, avatar_names); } } getChild("SearchResults")->deselectAllItems(TRUE); @@ -380,6 +381,9 @@ public: void LLFloaterAvatarPicker::find() { + //clear our stored LLAvatarNames + sAvatarNameMap.clear(); + std::string text = childGetValue("Edit").asString(); mQueryID.generate(); @@ -547,6 +551,14 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void* avatar_name = LLCacheName::buildFullName(first_name, last_name); search_results->setEnabled(TRUE); found_one = TRUE; + + LLAvatarName av_name; + av_name.mLegacyFirstName = first_name; + av_name.mLegacyLastName = last_name; + av_name.mDisplayName = avatar_name; + const LLUUID& agent_id = avatar_id; + sAvatarNameMap[agent_id] = av_name; + } LLSD element; element["id"] = avatar_id; // value @@ -594,20 +606,18 @@ void LLFloaterAvatarPicker::processResponse(const LLUUID& query_id, const LLSD& for ( ; it != agents.endArray(); ++it) { const LLSD& row = *it; - item["id"] = row["agent_id"]; + item["id"] = row["id"]; LLSD& columns = item["columns"]; columns[0]["column"] = "name"; columns[0]["value"] = row["display_name"]; - columns[1]["column"] = "slid"; - columns[1]["value"] = row["sl_id"]; - LLDate account_created = row["account_created"].asDate(); - S32 year, month, day; - account_created.split(&year, &month, &day); - std::string age = - LLDateUtil::ageFromDate(account_created, LLDate::now()); - columns[2]["column"] = "age"; - columns[2]["value"] = age; + columns[1]["column"] = "username"; + columns[1]["value"] = row["username"]; search_results->addElement(item); + + // add the avatar name to our list + LLAvatarName avatar_name; + avatar_name.fromLLSD(row); + sAvatarNameMap[row["id"].asUUID()] = avatar_name; } childEnable("ok_btn"); @@ -678,8 +688,8 @@ bool LLFloaterAvatarPicker::isSelectBtnEnabled() if(list) { uuid_vec_t avatar_ids; - std::vector avatar_names; - getSelectedAvatarData(list, avatar_names, avatar_ids); + std::vector avatar_names; + getSelectedAvatarData(list, avatar_ids, avatar_names); return mOkButtonValidateSignal(avatar_ids); } } -- cgit v1.2.3 From abcdff128c85c5a1188da8e36510f249e5918899 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 26 May 2010 16:24:08 -0700 Subject: Resident Chooser fixes --- indra/newview/llfloateravatarpicker.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index a838746a56..d9c580320a 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -266,15 +266,20 @@ void LLFloaterAvatarPicker::populateNearMe() if(av == gAgent.getID()) continue; LLSD element; element["id"] = av; // value - std::string fullname; - if(!gCacheName->getFullName(av, fullname)) + LLAvatarName av_name; + + if (!LLAvatarNameCache::get(av, &av_name)) { + element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = LLCacheName::getDefaultName(); all_loaded = FALSE; } else { - element["columns"][0]["value"] = fullname; + element["columns"][0]["column"] = "name"; + element["columns"][0]["value"] = av_name.mDisplayName; + element["columns"][1]["column"] = "username"; + element["columns"][1]["value"] = av_name.mUsername; } near_me_scroller->addElement(element); empty = FALSE; -- cgit v1.2.3 From 9874e4d1818661580d72f41a507b41d3e07aecd5 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 28 May 2010 13:27:30 -0700 Subject: fixed nearby and friends avatar picker bug --- indra/newview/llfloateravatarpicker.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index d9c580320a..b533e394ff 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -177,7 +177,20 @@ static void getSelectedAvatarData(const LLScrollListCtrl* from, uuid_vec_t& avat if (item->getUUID().notNull()) { avatar_ids.push_back(item->getUUID()); - avatar_names.push_back(sAvatarNameMap[item->getUUID()]); + + std::map::iterator iter = sAvatarNameMap.find(item->getUUID()); + if (iter != sAvatarNameMap.end()) + { + avatar_names.push_back(iter->second); + } + else + { + // the only case where it isn't in the name map is friends + // but it should be in the name cache + LLAvatarName av_name; + LLAvatarNameCache::get(item->getUUID(), &av_name); + avatar_names.push_back(av_name); + } } } } @@ -280,6 +293,8 @@ void LLFloaterAvatarPicker::populateNearMe() element["columns"][0]["value"] = av_name.mDisplayName; element["columns"][1]["column"] = "username"; element["columns"][1]["value"] = av_name.mUsername; + + sAvatarNameMap[av] = av_name; } near_me_scroller->addElement(element); empty = FALSE; @@ -314,7 +329,6 @@ void LLFloaterAvatarPicker::populateFriend() LLAvatarTracker::instance().applyFunctor(collector); LLCollectAllBuddies::buddy_map_t::iterator it; - for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) { friends_scroller->addStringUUIDItem(it->first, it->second); -- cgit v1.2.3 From 3057bb08be2b49553949a7aebb3dd3eb33c9de46 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 5 Aug 2010 09:53:10 -0700 Subject: DEV-52475 Avatar picker only shows 10 results for search --- indra/newview/llfloateravatarpicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 7ed6539387..8c39a8a2df 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -435,7 +435,7 @@ void LLFloaterAvatarPicker::find() { url += "/"; } - url += "?names="; + url += "?page_size=100&names="; url += LLURI::escape(text); llinfos << "avatar picker " << url << llendl; LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID)); -- cgit v1.2.3 From ab320a12e62152907bbec150972a9ac8a0e244fb Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 19 Aug 2010 15:48:51 -0700 Subject: DEV-52702 Avatar search in Viewer hangs with Searching... when searching for invalid characters in Viewer --- indra/newview/llfloateravatarpicker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloateravatarpicker.cpp') diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 8c39a8a2df..b44ebd043f 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -393,7 +393,9 @@ public: //LLSDSerialize::toPrettyXML(content, ss); //llinfos << ss.str() << llendl; - if (isGoodStatus(status)) + // in case of invalid characters, the avatar picker returns a 400 + // just set it to process so it displays 'not found' + if (isGoodStatus(status) || status == 400) { LLFloaterAvatarPicker* floater = LLFloaterReg::findTypedInstance("avatar_picker"); @@ -405,7 +407,8 @@ public: else { llinfos << "avatar picker failed " << status - << " reason " << reason << llendl; + << " reason " << reason << llendl; + } } }; -- cgit v1.2.3