summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-05-12 16:46:58 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-05-12 16:46:58 -0700
commitb95d1142a0a9c91388d4674951c319fff0785c0c (patch)
tree5828a8e719a01744aad6bea2ec63d90eecbcab08 /indra/llcommon
parentc3ccbecfdae1df3738775d1165cb3361b4f06d90 (diff)
parentbece97b1e11552a3feda74ffc24a5aac15728227 (diff)
Merge
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llavatarname.cpp15
-rw-r--r--indra/llcommon/llavatarname.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index 4eeb6e706d..7415acadd4 100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -79,3 +79,18 @@ void LLAvatarName::fromLLSD(const LLSD& sd)
LLDate expires = sd[DISPLAY_NAME_EXPIRES];
mExpires = expires.secondsSinceEpoch();
}
+
+std::string LLAvatarName::getNameAndSLID() const
+{
+ std::string name;
+ if (!mSLID.empty())
+ {
+ name = mDisplayName + " (" + mSLID + ")";
+ }
+ else
+ {
+ // ...display names are off, legacy name is in mDisplayName
+ name = mDisplayName;
+ }
+ return name;
+}
diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index d7d91e1c7a..87750210c6 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -49,6 +49,10 @@ public:
void fromLLSD(const LLSD& sd);
+ // For normal names, returns "James Linden (james.linden)"
+ // When display names are disabled returns just "James Linden"
+ std::string getNameAndSLID() const;
+
// "bobsmith123" or "james.linden", US-ASCII only
std::string mSLID;