diff options
author | James Cook <james@lindenlab.com> | 2010-02-08 14:55:30 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-02-08 14:55:30 -0800 |
commit | 42176145c9e81dd99b65f88152df50a7b3ccf834 (patch) | |
tree | bfca296db7fd5bbe793652dfecc12ba396dd2c25 | |
parent | 33e613531f929b5bce04c11a355085fe5ea92997 (diff) |
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
-rw-r--r-- | indra/llmessage/llcachename.cpp | 88 | ||||
-rw-r--r-- | indra/llmessage/llcachename.h | 15 | ||||
-rw-r--r-- | indra/llui/llurlentry.cpp | 65 | ||||
-rw-r--r-- | indra/llui/llurlentry.h | 1 | ||||
-rw-r--r-- | indra/llui/tests/llurlentry_stub.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llagentui.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llagentui.h | 1 | ||||
-rw-r--r-- | indra/newview/llavataractions.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterreporter.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llmutelist.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llpanelgroupinvite.cpp | 7 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 48 |
17 files changed, 165 insertions, 172 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index e6233ecf97..2bdf112448 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -220,7 +220,9 @@ public: Impl(LLMessageSystem* msg); ~Impl(); - + + BOOL getName(const LLUUID& id, std::string& first, std::string& last); + boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); void addPending(const LLUUID& id, const LLHost& host); @@ -480,7 +482,7 @@ void LLCacheName::exportFile(std::ostream& ostr) } -BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& last) +BOOL LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last) { if(id.isNull()) { @@ -489,7 +491,7 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las return FALSE; } - LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id ); + LLCacheNameEntry* entry = get_ptr_in_map(mCache, id ); if (entry) { first = entry->mFirstName; @@ -500,9 +502,9 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las { first = sCacheName["waiting"]; last.clear(); - if (!impl.isRequestPending(id)) + if (!isRequestPending(id)) { - impl.mAskNameQueue.insert(id); + mAskNameQueue.insert(id); } return FALSE; } @@ -521,11 +523,65 @@ void LLCacheName::LocalizeCacheName(std::string key, std::string value) BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) { std::string first_name, last_name; - BOOL res = getName(id, first_name, last_name); - fullname = buildFullname(first_name, last_name); + BOOL res = impl.getName(id, first_name, last_name); + fullname = buildFullName(first_name, last_name); return res; } +static std::map<LLUUID, std::string> sDisplayNames; + +bool LLCacheName::getDisplayName(const LLUUID& id, std::string& display_name) +{ + if (sDisplayNames.empty()) + { + LLUUID id; + const unsigned char miyazaki_hayao_san[] + = { 0xE5, 0xAE, 0xAE, 0xE5, 0xB4, 0x8E, + 0xE9, 0xA7, 0xBF, + 0xE3, 0x81, 0x95, 0xE3, 0x82, 0x93, '\0' }; + id.set("27888d5f-4ddb-4df3-ad36-a1483ce0b3d9"); // miyazaki23 + sDisplayNames[id] = (const char*)miyazaki_hayao_san; + + id.set("3e5bf676-3577-c9ee-9fac-10df430015a1"); // Jim Linden + sDisplayNames[id] = "Jim Jenkins"; + + const unsigned char jose_sanchez[] = + { 'J','o','s',0xC3,0xA9,' ','S','a','n','c','h','e','z', '\0' }; + id.set("a2e76fcd-9360-4f6d-a924-938f923df11a"); // James Linden + sDisplayNames[id] = (const char*)jose_sanchez; + + id.set("3f7ced39-5e38-4fdd-90f2-423560b1e6e2"); // Hamilton Linden + sDisplayNames[id] = "Hamilton Hitchings"; + + id.set("537da1e1-a89f-4f9b-9056-b1f0757ccdd0"); // Rome Linden + sDisplayNames[id] = "Rome Portlock"; + + id.set("244195d6-c9b7-4fd6-9229-c3a8b2e60e81"); // M Linden + sDisplayNames[id] = "Mark Kingdon"; + + id.set("49856302-98d4-4e32-b5e9-035e5b4e83a4"); // T Linden + sDisplayNames[id] = "Tom Hale"; + + id.set("e6ed7825-708f-4c6b-b6a7-f3fe921a9176"); // Callen Linden + sDisplayNames[id] = "Christina Allen"; + + id.set("a7f0ac18-205f-41d2-b5b4-f75f096ae511"); // Crimp Linden + sDisplayNames[id] = "Chris Rimple"; + } + + std::map<LLUUID,std::string>::iterator it = sDisplayNames.find(id); + if (it != sDisplayNames.end()) + { + display_name = it->second; + return true; + } + else + { + display_name = ""; + return false; + } +} + BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) { if(id.isNull()) @@ -562,7 +618,7 @@ BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) BOOL LLCacheName::getUUID(const std::string& first, const std::string& last, LLUUID& id) { - std::string fullname = buildFullname(first, last); + std::string fullname = buildFullName(first, last); return getUUID(fullname, id); } @@ -581,7 +637,7 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id) } //static -std::string LLCacheName::buildFullname(const std::string& first, const std::string& last) +std::string LLCacheName::buildFullName(const std::string& first, const std::string& last) { std::string fullname = first; if (!last.empty() @@ -625,7 +681,7 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, co else { std::string fullname = - buildFullname(entry->mFirstName, entry->mLastName); + buildFullName(entry->mFirstName, entry->mLastName); signal(id, fullname, entry->mIsGroup); } } @@ -722,7 +778,7 @@ void LLCacheName::dump() { llinfos << iter->first << " = " - << buildFullname(entry->mFirstName, entry->mLastName) + << buildFullName(entry->mFirstName, entry->mLastName) << " @ " << entry->mCreateTime << llendl; } @@ -769,7 +825,7 @@ void LLCacheName::Impl::processPendingReplies() if (!entry->mIsGroup) { std::string fullname = - LLCacheName::buildFullname(entry->mFirstName, entry->mLastName); + LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); (reply->mSignal)(reply->mID, fullname, false); } else @@ -952,10 +1008,10 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { - std::string fullname = - LLCacheName::buildFullname(entry->mFirstName, entry->mLastName); - mSignal(id, fullname, false); - mReverseCache[fullname] = id; + std::string full_name = + LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + mSignal(id, full_name, false); + mReverseCache[full_name] = id; } else { diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index c7385204f5..76865928d3 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -77,13 +77,16 @@ public: bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); - // If available, copies the first and last name into the strings provided. - // first must be at least DB_FIRST_NAME_BUF_SIZE characters. - // last must be at least DB_LAST_NAME_BUF_SIZE characters. + // If available, copies name ("bobsmith123" or "James Linden") into string // If not available, copies the string "waiting". // Returns TRUE iff available. - BOOL getName(const LLUUID& id, std::string& first, std::string& last); - BOOL getFullName(const LLUUID& id, std::string& fullname); + BOOL getFullName(const LLUUID& id, std::string& full_name); + + // IDEVO temporary code + // If available, copies display name (UTF-8) into string + // If not available, copies empty string + // Returns TRUE iff available + bool getDisplayName(const LLUUID& id, std::string& display_name); // Reverse lookup of UUID from name BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); @@ -91,7 +94,7 @@ public: // IDEVO Temporary code // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display - static std::string buildFullname(const std::string& first, const std::string& last); + static std::string buildFullName(const std::string& first, const std::string& last); // If available, this method copies the group name into the string // provided. The caller must allocate at least diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 0bbf1fe084..0b68b66ff9 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -312,66 +312,13 @@ LLUrlEntryAgent::LLUrlEntryAgent() } // IDEVO demo code -static std::string clean_name(const std::string& full_name) +std::string LLUrlEntryAgent::buildName(const LLUUID& id, const std::string& full_name) { - std::string displayname; - if (full_name == "miyazaki23") // IDEVO demo code - { - // miyazaki - displayname += (char)(0xE5); - displayname += (char)(0xAE); - displayname += (char)(0xAE); - displayname += (char)(0xE5); - displayname += (char)(0xB4); - displayname += (char)(0x8E); - // hayao - displayname += (char)(0xE9); - displayname += (char)(0xA7); - displayname += (char)(0xBF); - // san - displayname += (char)(0xE3); - displayname += (char)(0x81); - displayname += (char)(0x95); - displayname += (char)(0xE3); - displayname += (char)(0x82); - displayname += (char)(0x93); - } - else if (full_name == "Jim Linden") - { - displayname = "Jos"; - displayname += (char)(0xC3); - displayname += (char)(0xA9); - displayname += " Sanchez"; - } - else if (full_name == "James Linden") - { - displayname = "James Cook"; - } - else if (full_name == "Hamilton Linden") - { - displayname = "Hamilton Hitchings"; - } - else if (full_name == "Rome Linden") - { - displayname = "Rome Portlock"; - } - else if (full_name == "M Linden") - { - displayname = "Mark Kingdon"; - } - else if (full_name == "T Linden") - { - displayname = "Tom Hale"; - } - else if (full_name == "Callen Linden") - { - displayname = "Christina Allen"; - } - std::string final; - if (!displayname.empty()) + std::string display_name; + if (gCacheName->getDisplayName(id, display_name)) { - final = displayname + " (" + full_name + ")"; + final = display_name + " (" + full_name + ")"; } else { @@ -384,7 +331,7 @@ void LLUrlEntryAgent::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) { - std::string final = clean_name(full_name); + std::string final = buildName(id, full_name); // received the agent name from the server - tell our observers callObservers(id.asString(), final); } @@ -412,7 +359,7 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } else if (gCacheName->getFullName(agent_id, full_name)) { - return clean_name(full_name); + return buildName(agent_id, full_name); } else { diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index e6844b595c..77802957a3 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -170,6 +170,7 @@ public: /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); private: void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); + std::string buildName(const LLUUID& id, const std::string& full_name); }; /// diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp index 30bab1eb91..35c49fc37f 100644 --- a/indra/llui/tests/llurlentry_stub.cpp +++ b/indra/llui/tests/llurlentry_stub.cpp @@ -36,11 +36,10 @@ BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname) return TRUE; } -BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& last) +bool LLCacheName::getDisplayName(const LLUUID& id, std::string& display_name) { - first = "Lynx"; - last = "Linden"; - return TRUE; + display_name = ""; + return false; } BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group) diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 7404fe5bc4..1bc9aa0f2b 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -46,31 +46,6 @@ #include "llslurl.h" //static -void LLAgentUI::buildName(std::string& name) -{ - name.clear(); - - LLVOAvatarSelf* avatar_object = gAgent.getAvatarObject(); - if (avatar_object) - { - LLNameValue *first_nv = avatar_object->getNVPair("FirstName"); - LLNameValue *last_nv = avatar_object->getNVPair("LastName"); - if (first_nv && last_nv) - { - name = first_nv->printData() + " " + last_nv->printData(); - } - else - { - llwarns << "Agent is missing FirstName and/or LastName nv pair." << llendl; - } - } - else - { - name = gSavedSettings.getString("FirstName") + " " + gSavedSettings.getString("LastName"); - } -} - -//static void LLAgentUI::buildFullname(std::string& name) { if (gAgent.getAvatarObject()) name = gAgent.getAvatarObject()->getFullname(); diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index 3478793e38..c682d3c951 100644 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -45,7 +45,6 @@ public: LOCATION_FORMAT_FULL, // Parcel, Region (x, y, z) - Maturity }; - static void buildName(std::string& name); static void buildFullname(std::string &name); static std::string buildSLURL(const bool escaped = true); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 7935c32d82..7f20eb02ea 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -103,7 +103,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id) } std::string full_name; - // IDEVO gCacheName->getFullName(id, full_name); + gCacheName->getFullName(id, full_name); requestFriendshipDialog(id, full_name); } 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; } diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 0f3c176cea..a97c21ff6c 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -39,6 +39,7 @@ // linden library includes #include "llassetstorage.h" +#include "llcachename.h" #include "llfontgl.h" #include "llimagej2c.h" #include "llinventory.h" @@ -270,9 +271,8 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) LLNameValue* lastname = objectp->getNVPair("LastName"); if (firstname && lastname) { - object_owner.append(firstname->getString()); - object_owner.append(1, ' '); - object_owner.append(lastname->getString()); + object_owner = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } else { diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 62085a47b4..38a518c5fd 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -118,9 +118,8 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) LLNameValue* lastname = mute_object->getNVPair("LastName"); if (firstname && lastname) { - mName.assign( firstname->getString() ); - mName.append(" "); - mName.append( lastname->getString() ); + mName = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } mType = mute_object->isAvatar() ? AGENT : OBJECT; } diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 06a682c905..0e677ee2bf 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -408,14 +408,13 @@ void LLPanelGroupInvite::addUsers(std::vector<LLUUID>& agent_ids) if(dest && dest->isAvatar()) { std::string fullname; - LLSD args; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = std::string(nvfirst->getString()); - args["LAST"] = std::string(nvlast->getString()); - fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); + fullname = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); + } if (!fullname.empty()) { diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index bf1e307d71..fa1c99ece7 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -854,23 +854,38 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l || !existing_inspector->getVisible() || existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID()) { - std::string avatar_name; - LLNameValue* firstname = hover_object->getNVPair("FirstName"); - LLNameValue* lastname = hover_object->getNVPair("LastName"); - if (firstname && lastname) + // IDEVO JAMESDEBUG try to get display name + SLID + std::string final_name; + std::string full_name; + if (!gCacheName->getFullName(hover_object->getID(), full_name)) { - avatar_name = llformat("%s %s", firstname->getString(), lastname->getString()); + LLNameValue* firstname = hover_object->getNVPair("FirstName"); + LLNameValue* lastname = hover_object->getNVPair("LastName"); + if (firstname && lastname) + { + full_name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); + } + else + { + full_name = LLTrans::getString("TooltipPerson"); + } + } + std::string display_name; + if (gCacheName->getDisplayName(hover_object->getID(), display_name)) + { + final_name = display_name + " (" + full_name + ")"; } else { - avatar_name = LLTrans::getString("TooltipPerson"); + final_name = full_name; } - + // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; LLInspector::Params p; p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); - p.message(avatar_name); + p.message(final_name); p.image.name("Inspector_I"); p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); p.visible_time_near(6.f); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6eb607fc6c..6f6932367f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2758,9 +2758,8 @@ class LLObjectMute : public view_listener_t LLNameValue *lastname = avatar->getNVPair("LastName"); if (firstname && lastname) { - name = firstname->getString(); - name += " "; - name += lastname->getString(); + name = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } type = LLMute::AGENT; @@ -3517,21 +3516,17 @@ void request_friendship(const LLUUID& dest_id) LLViewerObject* dest = gObjectList.findObject(dest_id); if(dest && dest->isAvatar()) { - std::string fullname; - LLSD args; + std::string full_name; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - fullname = nvfirst->getString(); - fullname += " "; - fullname += nvlast->getString(); + full_name = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); } - if (!fullname.empty()) + if (!full_name.empty()) { - LLAvatarActions::requestFriendshipDialog(dest_id, fullname); + LLAvatarActions::requestFriendshipDialog(dest_id, full_name); } else { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 266cad67f4..3cc6b9b591 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2517,9 +2517,8 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) LLNameValue* nvlast = source->getNVPair("LastName"); if (nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - source_name = std::string(nvfirst->getString()) + " " + nvlast->getString(); + source_name = LLCacheName::buildFullName( + nvfirst->getString(), nvlast->getString()); } } @@ -5065,7 +5064,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) // so we'll reuse the same namespace for both throttle types. std::string throttle_name = owner_name; std::string self_name; - LLAgentUI::buildName( self_name ); + LLAgentUI::buildFullname( self_name ); if( owner_name == self_name ) { throttle_name = taskid.getString(); @@ -5708,7 +5707,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLNotificationPtr notification; if (!first_name.empty()) { - args["NAME"] = LLCacheName::buildFullname(first_name, last_name); + args["NAME"] = LLCacheName::buildFullName(first_name, last_name); notification = LLNotifications::instance().add( LLNotification::Params("ScriptDialog").substitutions(args).payload(payload).form_elements(form.asLLSD())); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fdc6675db1..3f815314f0 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1180,12 +1180,8 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S //SetBKColor(hdc, RGB(255, 255, 255)); FillRect(hdc, &wnd_rect, CreateSolidBrush(RGB(255, 255, 255))); - std::string name_str; - LLAgentUI::buildName(name_str); - std::string temp_str; - temp_str = llformat( "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ - name_str.c_str(), + temp_str = llformat( "FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ LLViewerStats::getInstance()->mFPSStat.getMeanPerSec(), LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0), LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0)); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7df24c9ade..4f7b93b19d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -44,6 +44,7 @@ #include <ctype.h> #include "llaudioengine.h" +#include "llcachename.h" #include "noise.h" #include "sound_ids.h" @@ -2773,31 +2774,42 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) || is_appearance != mNameAppearance) { std::string line; - if (!sRenderGroupTitles) - { - // If all group titles are turned off, stack first name - // on a line above last name - line += firstname->getString(); - line += "\n"; - } - else if (title && title->getString() && title->getString()[0] != '\0') + // IDEVO JAMESDEBUG + //if (!sRenderGroupTitles) + //{ + // // If all group titles are turned off, stack first name + // // on a line above last name + // line += firstname->getString(); + // line += "\n"; + //} + //else if (title && title->getString() && title->getString()[0] != '\0') + //{ + // line += title->getString(); + // LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); + // line += "\n"; + // line += firstname->getString(); + //} + //else + //{ + // line += firstname->getString(); + //} + if (title && title->getString() && title->getString()[0] != '\0') { line += title->getString(); LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR); line += "\n"; - line += firstname->getString(); } - else + + std::string display_name; + if (gCacheName->getDisplayName(getID(), display_name)) { - line += firstname->getString(); + line += display_name; } - - // Suppress last name "Resident" as this is used for new SLID names - if (strcmp(lastname->getString(), "Resident")) + else { - line += " "; - line += lastname->getString(); + line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); } + BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) @@ -7520,9 +7532,7 @@ std::string LLVOAvatar::getFullname() const LLNameValue* last = getNVPair("LastName"); if (first && last) { - name += first->getString(); - name += " "; - name += last->getString(); + name = LLCacheName::buildFullName( first->getString(), last->getString() ); } return name; |