summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llurlentry.cpp22
-rw-r--r--indra/llui/llurlentry.h3
-rw-r--r--indra/llui/tests/llurlentry_stub.cpp7
3 files changed, 17 insertions, 15 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 0b68b66ff9..dae2c44f08 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -35,6 +35,7 @@
#include "llurlentry.h"
#include "lluri.h"
+#include "llavatarnamecache.h"
#include "llcachename.h"
#include "lltrans.h"
#include "lluicolortable.h"
@@ -312,26 +313,19 @@ LLUrlEntryAgent::LLUrlEntryAgent()
}
// IDEVO demo code
-std::string LLUrlEntryAgent::buildName(const LLUUID& id, const std::string& full_name)
+std::string LLUrlEntryAgent::buildName(const LLUUID& id)
{
- std::string final;
- std::string display_name;
- if (gCacheName->getDisplayName(id, display_name))
- {
- final = display_name + " (" + full_name + ")";
- }
- else
- {
- final = full_name;
- }
- return final;
+ // JAMESDEBUG HACK: assume name is there
+ LLAvatarName av_name;
+ LLAvatarNameCache::get(id, &av_name);
+ return av_name.mDisplayName + " (" + av_name.mSLID + ")";
}
void LLUrlEntryAgent::onNameCache(const LLUUID& id,
const std::string& full_name,
bool is_group)
{
- std::string final = buildName(id, full_name);
+ std::string final = buildName(id);
// received the agent name from the server - tell our observers
callObservers(id.asString(), final);
}
@@ -359,7 +353,7 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
}
else if (gCacheName->getFullName(agent_id, full_name))
{
- return buildName(agent_id, full_name);
+ return buildName(agent_id);
}
else
{
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 77802957a3..2bc21eb989 100644
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -168,9 +168,10 @@ class LLUrlEntryAgent : public LLUrlEntryBase
public:
LLUrlEntryAgent();
/*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);
+ std::string buildName(const LLUUID& id);
};
///
diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp
index 35c49fc37f..016969451e 100644
--- a/indra/llui/tests/llurlentry_stub.cpp
+++ b/indra/llui/tests/llurlentry_stub.cpp
@@ -22,11 +22,18 @@
#include "llstring.h"
#include "llfile.h"
+#include "llavatarnamecache.h"
#include "llcachename.h"
#include "lluuid.h"
#include <string>
+// Stub for LLAvatarNameCache
+bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
+{
+ return false;
+}
+
//
// Stub implementation for LLCacheName
//