summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llmessage/llcachename.cpp132
-rw-r--r--indra/llmessage/llcachename.h28
-rw-r--r--indra/llmessage/mean_collision_data.h5
-rw-r--r--indra/llui/lltextbase.cpp2
-rw-r--r--indra/llui/llurlentry.cpp50
-rw-r--r--indra/llui/llurlentry.h8
-rw-r--r--indra/llui/llurlregistry.cpp9
-rw-r--r--indra/llui/llurlregistry.h4
-rw-r--r--indra/llui/tests/llurlentry_stub.cpp8
-rw-r--r--indra/llui/tests/llurlentry_test.cpp1
-rw-r--r--indra/newview/llagentui.cpp25
-rw-r--r--indra/newview/llagentui.h1
-rw-r--r--indra/newview/llavataractions.cpp16
-rw-r--r--indra/newview/llavatariconctrl.cpp15
-rw-r--r--indra/newview/llavatariconctrl.h11
-rw-r--r--indra/newview/llavatarlistitem.cpp7
-rw-r--r--indra/newview/llavatarlistitem.h2
-rw-r--r--indra/newview/llcallingcard.cpp25
-rw-r--r--indra/newview/llcallingcard.h9
-rw-r--r--indra/newview/llchathistory.cpp21
-rw-r--r--indra/newview/llfloateravatarpicker.cpp3
-rw-r--r--indra/newview/llfloaterbump.cpp5
-rw-r--r--indra/newview/llfloaterbuyland.cpp16
-rw-r--r--indra/newview/llfloaterland.cpp7
-rw-r--r--indra/newview/llfloaterpay.cpp36
-rw-r--r--indra/newview/llfloaterreporter.cpp6
-rw-r--r--indra/newview/llfloaterscriptlimits.cpp12
-rw-r--r--indra/newview/llfloaterscriptlimits.h4
-rw-r--r--indra/newview/llhudtext.cpp6
-rw-r--r--indra/newview/llhudtext.h2
-rw-r--r--indra/newview/llimview.cpp14
-rw-r--r--indra/newview/llimview.h2
-rw-r--r--indra/newview/llinspectavatar.cpp36
-rw-r--r--indra/newview/llinspectgroup.cpp17
-rw-r--r--indra/newview/llinspectremoteobject.cpp17
-rw-r--r--indra/newview/llinventorymodel.cpp3
-rw-r--r--indra/newview/llmutelist.cpp33
-rw-r--r--indra/newview/llmutelist.h2
-rw-r--r--indra/newview/llnamebox.cpp19
-rw-r--r--indra/newview/llnamebox.h5
-rw-r--r--indra/newview/llnameeditor.cpp19
-rw-r--r--indra/newview/llnameeditor.h5
-rw-r--r--indra/newview/llnamelistctrl.cpp20
-rw-r--r--indra/newview/llnamelistctrl.h5
-rw-r--r--indra/newview/llnotificationhandlerutil.cpp7
-rw-r--r--indra/newview/llpanelavatar.cpp7
-rw-r--r--indra/newview/llpanelavatartag.cpp2
-rw-r--r--indra/newview/llpanelgroupinvite.cpp7
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp21
-rw-r--r--indra/newview/llpanelimcontrolpanel.h3
-rw-r--r--indra/newview/llpanellandmarkinfo.cpp39
-rw-r--r--indra/newview/llpanellogin.cpp47
-rw-r--r--indra/newview/llpanelme.cpp14
-rw-r--r--indra/newview/llpanelmediasettingspermissions.cpp34
-rw-r--r--indra/newview/llpanelpermissions.cpp2
-rw-r--r--indra/newview/llpanelpicks.cpp14
-rw-r--r--indra/newview/llpanelplaceinfo.cpp6
-rw-r--r--indra/newview/llpanelplaceinfo.h4
-rw-r--r--indra/newview/llpanelplaceprofile.cpp25
-rw-r--r--indra/newview/llpanelprofileview.cpp8
-rw-r--r--indra/newview/llpanelprofileview.h7
-rw-r--r--indra/newview/llsidepaneltaskinfo.cpp2
-rw-r--r--indra/newview/llspeakers.cpp7
-rw-r--r--indra/newview/llspeakers.h2
-rw-r--r--indra/newview/llstartup.cpp10
-rw-r--r--indra/newview/lltoolpie.cpp23
-rw-r--r--indra/newview/llviewerinventory.cpp4
-rw-r--r--indra/newview/llviewerinventory.h2
-rw-r--r--indra/newview/llviewermenu.cpp78
-rw-r--r--indra/newview/llviewermessage.cpp158
-rw-r--r--indra/newview/llviewerparcelmgr.cpp7
-rw-r--r--indra/newview/llviewerwindow.cpp8
-rw-r--r--indra/newview/llvoavatar.cpp565
-rw-r--r--indra/newview/llvoavatar.h12
-rw-r--r--indra/newview/llvoiceclient.cpp14
-rw-r--r--indra/newview/llvoiceclient.h1
-rw-r--r--indra/newview/skins/default/colors.xml3
-rw-r--r--indra/newview/skins/default/xui/en/floater_bumps.xml10
-rw-r--r--indra/newview/skins/default/xui/en/floater_pay.xml17
-rw-r--r--indra/newview/skins/default/xui/en/floater_pay_object.xml28
-rw-r--r--indra/newview/skins/default/xui/en/inspect_avatar.xml15
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml71
-rw-r--r--indra/newview/skins/default/xui/en/panel_login.xml18
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml2
84 files changed, 1017 insertions, 960 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 9363b3a8d5..4b0cc299c7 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -75,7 +75,7 @@ public:
public:
bool mIsGroup;
U32 mCreateTime; // unix time_t
- std::string mFirstName;
+ std::string mFirstName; // IDEVO TODO collapse to one field
std::string mLastName;
std::string mGroupName;
};
@@ -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);
@@ -463,7 +465,7 @@ void LLCacheName::exportFile(std::ostream& ostr)
// store it
LLUUID id = iter->first;
std::string id_str = id.asString();
- if(!entry->mFirstName.empty() && !entry->mLastName.empty())
+ if(!entry->mFirstName.empty() /* && !entry->mLastName.empty() */ ) // IDEVO save SLIDs
{
data[AGENTS][id_str][FIRST] = entry->mFirstName;
data[AGENTS][id_str][LAST] = entry->mLastName;
@@ -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,14 +502,15 @@ 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;
}
}
+
// static
void LLCacheName::LocalizeCacheName(std::string key, std::string value)
{
@@ -520,11 +523,68 @@ 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 = 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("a23fff6c-80ae-4997-9253-48272fd01d3c"); // bobsmith123
+ 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())
@@ -561,7 +621,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 = first + " " + last;
+ std::string fullname = buildFullName(first, last);
return getUUID(fullname, id);
}
@@ -579,6 +639,19 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id)
}
}
+//static
+std::string LLCacheName::buildFullName(const std::string& first, const std::string& last)
+{
+ std::string fullname = first;
+ if (!last.empty()
+ && last != "Resident")
+ {
+ fullname += ' ';
+ fullname += last;
+ }
+ return fullname;
+}
+
// This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer.
// The reason it is a slot is so that the legacy get() function below can bind an old callback
// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior
@@ -586,7 +659,7 @@ BOOL LLCacheName::getUUID(const std::string& fullname, LLUUID& id)
// we call it immediately. -Steve
// NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the
// potential need for any parsing should any code need to handle first and last name independently.
-boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback)
+boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback)
{
boost::signals2::connection res;
@@ -594,7 +667,7 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co
{
LLCacheNameSignal signal;
signal.connect(callback);
- signal(id, sCacheName["nobody"], "", is_group);
+ signal(id, sCacheName["nobody"], is_group);
return res;
}
@@ -606,11 +679,13 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co
// id found in map therefore we can call the callback immediately.
if (entry->mIsGroup)
{
- signal(id, entry->mGroupName, "", entry->mIsGroup);
+ signal(id, entry->mGroupName, entry->mIsGroup);
}
else
{
- signal(id, entry->mFirstName, entry->mLastName, entry->mIsGroup);
+ std::string fullname =
+ buildFullName(entry->mFirstName, entry->mLastName);
+ signal(id, fullname, entry->mIsGroup);
}
}
else
@@ -632,9 +707,9 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, co
return res;
}
-boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data)
+boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data)
{
- return get(id, is_group, boost::bind(callback, _1, _2, _3, _4, user_data));
+ return get(id, is_group, boost::bind(callback, _1, _2, _3, user_data));
}
void LLCacheName::processPending()
@@ -706,7 +781,7 @@ void LLCacheName::dump()
{
llinfos
<< iter->first << " = "
- << entry->mFirstName << " " << entry->mLastName
+ << buildFullName(entry->mFirstName, entry->mLastName)
<< " @ " << entry->mCreateTime
<< llendl;
}
@@ -752,11 +827,13 @@ void LLCacheName::Impl::processPendingReplies()
if (!entry->mIsGroup)
{
- (reply->mSignal)(reply->mID, entry->mFirstName, entry->mLastName, FALSE);
+ std::string fullname =
+ LLCacheName::buildFullName(entry->mFirstName, entry->mLastName);
+ (reply->mSignal)(reply->mID, fullname, false);
}
else
{
- (reply->mSignal)(reply->mID, entry->mGroupName, "", TRUE);
+ (reply->mSignal)(reply->mID, entry->mGroupName, true);
}
}
@@ -918,6 +995,13 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup)
{
msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_FirstName, entry->mFirstName, i);
msg->getStringFast(_PREHASH_UUIDNameBlock, _PREHASH_LastName, entry->mLastName, i);
+
+ // IDEVO blank out last name for storage to reduce string compares on
+ // retrieval. Eventually need to convert to single mName field.
+ if (entry->mLastName == "Resident")
+ {
+ entry->mLastName = "";
+ }
}
else
{ // is group
@@ -927,13 +1011,14 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup)
if (!isGroup)
{
- mSignal(id, entry->mFirstName, entry->mLastName, FALSE);
- std::string fullname = entry->mFirstName + " " + entry->mLastName;
- mReverseCache[fullname] = id;
+ std::string full_name =
+ LLCacheName::buildFullName(entry->mFirstName, entry->mLastName);
+ mSignal(id, full_name, false);
+ mReverseCache[full_name] = id;
}
else
{
- mSignal(id, entry->mGroupName, "", TRUE);
+ mSignal(id, entry->mGroupName, true);
mReverseCache[entry->mGroupName] = id;
}
}
@@ -962,4 +1047,3 @@ void LLCacheName::Impl::handleUUIDGroupNameReply(LLMessageSystem* msg, void** us
{
((LLCacheName::Impl*)userData)->processUUIDReply(msg, true);
}
-
diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h
index 111cc8b650..76865928d3 100644
--- a/indra/llmessage/llcachename.h
+++ b/indra/llmessage/llcachename.h
@@ -42,13 +42,12 @@ class LLUUID;
typedef boost::signals2::signal<void (const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name,
- BOOL is_group)> LLCacheNameSignal;
+ const std::string& name,
+ bool is_group)> LLCacheNameSignal;
typedef LLCacheNameSignal::slot_type LLCacheNameCallback;
// Old callback with user data for compatability
-typedef void (*old_callback_t)(const LLUUID&, const std::string&, const std::string&, BOOL, void*);
+typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*);
// Here's the theory:
// If you request a name that isn't in the cache, it returns "waiting"
@@ -78,17 +77,24 @@ 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);
BOOL getUUID(const std::string& fullname, LLUUID& id);
+
+ // 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);
// If available, this method copies the group name into the string
// provided. The caller must allocate at least
@@ -100,10 +106,10 @@ public:
// If the data is currently available, may call the callback immediatly
// otherwise, will request the data, and will call the callback when
// available. There is no garuntee the callback will ever be called.
- boost::signals2::connection get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback);
+ boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback);
// LEGACY
- boost::signals2::connection get(const LLUUID& id, BOOL is_group, old_callback_t callback, void* user_data);
+ boost::signals2::connection get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data);
// This method needs to be called from time to time to send out
// requests.
void processPending();
diff --git a/indra/llmessage/mean_collision_data.h b/indra/llmessage/mean_collision_data.h
index 03b96f9f90..a6c635e81e 100644
--- a/indra/llmessage/mean_collision_data.h
+++ b/indra/llmessage/mean_collision_data.h
@@ -61,7 +61,7 @@ public:
LLMeanCollisionData(LLMeanCollisionData *mcd)
: mVictim(mcd->mVictim), mPerp(mcd->mPerp), mTime(mcd->mTime), mType(mcd->mType), mMag(mcd->mMag),
- mFirstName(mcd->mFirstName), mLastName(mcd->mLastName)
+ mFullName(mcd->mFullName)
{
}
@@ -95,8 +95,7 @@ public:
time_t mTime;
EMeanCollisionType mType;
F32 mMag;
- std::string mFirstName;
- std::string mLastName;
+ std::string mFullName;
};
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index b84e6f45fb..ef422dbdc5 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1578,7 +1578,7 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c
// Text will be replaced during rendering with the icon,
// but string cannot be empty or the segment won't be
// added (or drawn).
- appendAndHighlightText(" ", prepend_newline, part, icon);
+ appendAndHighlightText(" ", prepend_newline, part, icon);
prepend_newline = false;
}
}
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 92b7816bdd..0b68b66ff9 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -311,13 +311,29 @@ LLUrlEntryAgent::LLUrlEntryAgent()
mColor = LLUIColorTable::instance().getColor("AgentLinkColor");
}
-void LLUrlEntryAgent::onAgentNameReceived(const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group)
+// IDEVO demo code
+std::string LLUrlEntryAgent::buildName(const LLUUID& id, const std::string& full_name)
{
+ std::string final;
+ std::string display_name;
+ if (gCacheName->getDisplayName(id, display_name))
+ {
+ final = display_name + " (" + full_name + ")";
+ }
+ else
+ {
+ final = full_name;
+ }
+ return final;
+}
+
+void LLUrlEntryAgent::onNameCache(const LLUUID& id,
+ const std::string& full_name,
+ bool is_group)
+{
+ std::string final = buildName(id, full_name);
// received the agent name from the server - tell our observers
- callObservers(id.asString(), first + " " + last);
+ callObservers(id.asString(), final);
}
std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
@@ -327,14 +343,14 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
// probably at the login screen, use short string for layout
return LLTrans::getString("LoadingData");
}
-
+
std::string agent_id_string = getIDStringFromUrl(url);
if (agent_id_string.empty())
{
// something went wrong, just give raw url
return unescapeUrl(url);
}
-
+
LLUUID agent_id(agent_id_string);
std::string full_name;
if (agent_id.isNull())
@@ -343,18 +359,19 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
}
else if (gCacheName->getFullName(agent_id, full_name))
{
- return full_name;
+ return buildName(agent_id, full_name);
}
else
{
- gCacheName->get(agent_id, FALSE,
- boost::bind(&LLUrlEntryAgent::onAgentNameReceived,
- this, _1, _2, _3, _4));
+ gCacheName->get(agent_id, false,
+ boost::bind(&LLUrlEntryAgent::onNameCache,
+ this, _1, _2, _3));
addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData");
}
}
+
//
// LLUrlEntryGroup Describes a Second Life group Url, e.g.,
// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about
@@ -371,12 +388,11 @@ LLUrlEntryGroup::LLUrlEntryGroup()
}
void LLUrlEntryGroup::onGroupNameReceived(const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group)
+ const std::string& name,
+ bool is_group)
{
// received the group name from the server - tell our observers
- callObservers(id.asString(), first);
+ callObservers(id.asString(), name);
}
std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
@@ -406,9 +422,9 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa
}
else
{
- gCacheName->get(group_id, TRUE,
+ gCacheName->get(group_id, true,
boost::bind(&LLUrlEntryGroup::onGroupNameReceived,
- this, _1, _2, _3, _4));
+ this, _1, _2, _3));
addObserver(group_id_string, url, cb);
return LLTrans::getString("LoadingData");
}
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index 3abada0f24..77802957a3 100644
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -163,15 +163,14 @@ public:
///
/// LLUrlEntryAgent Describes a Second Life agent Url, e.g.,
/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about
-///
class LLUrlEntryAgent : public LLUrlEntryBase
{
public:
LLUrlEntryAgent();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
private:
- void onAgentNameReceived(const LLUUID& id, const std::string& first,
- const std::string& last, BOOL is_group);
+ void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group);
+ std::string buildName(const LLUUID& id, const std::string& full_name);
};
///
@@ -184,8 +183,7 @@ public:
LLUrlEntryGroup();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
private:
- void onGroupNameReceived(const LLUUID& id, const std::string& first,
- const std::string& last, BOOL is_group);
+ void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group);
};
///
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 722dbe41b3..5db1f46b8d 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -43,6 +43,8 @@ void LLUrlRegistryNullCallback(const std::string &url, const std::string &label)
LLUrlRegistry::LLUrlRegistry()
{
+ mUrlEntry.reserve(16);
+
// Urls are matched in the order that they were registered
registerUrl(new LLUrlEntryNoLink());
registerUrl(new LLUrlEntrySLURL());
@@ -74,11 +76,14 @@ LLUrlRegistry::~LLUrlRegistry()
}
}
-void LLUrlRegistry::registerUrl(LLUrlEntryBase *url)
+void LLUrlRegistry::registerUrl(LLUrlEntryBase *url, bool force_front)
{
if (url)
{
- mUrlEntry.push_back(url);
+ if (force_front) // IDEVO
+ mUrlEntry.insert(mUrlEntry.begin(), url);
+ else
+ mUrlEntry.push_back(url);
}
}
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index 399ee0a988..6d47c2c2a2 100644
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -70,7 +70,9 @@ public:
~LLUrlRegistry();
/// add a new Url handler to the registry (will be freed on destruction)
- void registerUrl(LLUrlEntryBase *url);
+ /// optionally force it to the front of the list, making it take
+ /// priority over other regular expression matches for URLs
+ void registerUrl(LLUrlEntryBase *url, bool force_front = false);
/// get the next Url in an input string, starting at a given character offset
/// your callback is invoked if the matched Url's label changes in the future
diff --git a/indra/llui/tests/llurlentry_stub.cpp b/indra/llui/tests/llurlentry_stub.cpp
index 26d1f2e067..35c49fc37f 100644
--- a/indra/llui/tests/llurlentry_stub.cpp
+++ b/indra/llui/tests/llurlentry_stub.cpp
@@ -36,13 +36,19 @@ BOOL LLCacheName::getFullName(const LLUUID& id, std::string& fullname)
return TRUE;
}
+bool LLCacheName::getDisplayName(const LLUUID& id, std::string& display_name)
+{
+ display_name = "";
+ return false;
+}
+
BOOL LLCacheName::getGroupName(const LLUUID& id, std::string& group)
{
group = "My Group";
return TRUE;
}
-boost::signals2::connection LLCacheName::get(const LLUUID& id, BOOL is_group, const LLCacheNameCallback& callback)
+boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback)
{
return boost::signals2::connection();
}
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index cbb303a059..bcb1e65092 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -285,7 +285,6 @@ namespace tut
testRegex("Agent Url alternate command", url,
"XXX secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/foobar",
"secondlife:///App/AGENT/0E346D8B-4433-4d66-a6b0-fd37083abc4c/foobar");
-
}
template<> template<>
diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp
index 72ab9235cf..c890988930 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 1d75374930..9e136b7cfb 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -62,6 +62,7 @@
#include "llimfloater.h"
#include "lltrans.h"
#include "llcallingcard.h"
+#include "llslurl.h" // IDEVO
// static
void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name)
@@ -73,7 +74,7 @@ void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::strin
}
LLSD args;
- args["NAME"] = name;
+ args["NAME"] = LLSLURL::buildCommand("agent", id, "inspect");
LLSD payload;
payload["id"] = id;
payload["name"] = name;
@@ -128,11 +129,10 @@ void LLAvatarActions::removeFriendsDialog(const std::vector<LLUUID>& ids)
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
- std::string first, last;
- if(gCacheName->getName(agent_id, first, last))
+ std::string full_name;
+ if(gCacheName->getFullName(agent_id, full_name))
{
- args["FIRST_NAME"] = first;
- args["LAST_NAME"] = last;
+ args["NAME"] = full_name;
}
msgType = "RemoveFromFriends";
@@ -621,9 +621,9 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
// static
bool LLAvatarActions::canBlock(const LLUUID& id)
{
- std::string firstname, lastname;
- gCacheName->getName(id, firstname, lastname);
- bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
+ std::string full_name;
+ gCacheName->getFullName(id, full_name);
+ bool is_linden = (full_name.find("Linden") != std::string::npos);
bool is_self = id == gAgentID;
return !is_self && !is_linden;
}
diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp
index 87b8d807c4..11cc456695 100644
--- a/indra/newview/llavatariconctrl.cpp
+++ b/indra/newview/llavatariconctrl.cpp
@@ -244,7 +244,8 @@ void LLAvatarIconCtrl::setValue(const LLSD& value)
LLIconCtrl::setValue(value);
}
- gCacheName->get(mAvatarId, FALSE, boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3, _4));
+ gCacheName->get(mAvatarId, false,
+ boost::bind(&LLAvatarIconCtrl::nameUpdatedCallback, this, _1, _2, _3));
}
bool LLAvatarIconCtrl::updateFromCache()
@@ -289,22 +290,20 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type)
void LLAvatarIconCtrl::nameUpdatedCallback(
const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group)
+ const std::string& name,
+ bool is_group)
{
if (id == mAvatarId)
{
- mFirstName = first;
- mLastName = last;
+ mFullName = name;
if (mDrawTooltip)
{
- setToolTip(mFirstName + " " + mLastName);
+ setToolTip(name);
}
else
{
- setToolTip(std::string(""));
+ setToolTip(std::string());
}
}
}
diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h
index 38616b7852..a5452ee1d3 100644
--- a/indra/newview/llavatariconctrl.h
+++ b/indra/newview/llavatariconctrl.h
@@ -92,20 +92,17 @@ public:
void nameUpdatedCallback(
const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group);
+ const std::string& name,
+ bool is_group);
const LLUUID& getAvatarId() const { return mAvatarId; }
- const std::string& getFirstName() const { return mFirstName; }
- const std::string& getLastName() const { return mLastName; }
+ const std::string& getFullName() const { return mFullName; }
void setDrawTooltip(bool value) { mDrawTooltip = value;}
protected:
LLUUID mAvatarId;
- std::string mFirstName;
- std::string mLastName;
+ std::string mFullName;
bool mDrawTooltip;
std::string mDefaultIconName;
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 846b2843dd..bf0121f5fd 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -225,7 +225,7 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes)
LLAvatarTracker::instance().addParticularFriendObserver(mAvatarId, this);
// Set avatar name.
- gCacheName->get(id, FALSE, boost::bind(&LLAvatarListItem::onNameCache, this, _2, _3));
+ gCacheName->get(id, false, boost::bind(&LLAvatarListItem::onNameCache, this, _2));
}
void LLAvatarListItem::showLastInteractionTime(bool show)
@@ -330,10 +330,9 @@ void LLAvatarListItem::setNameInternal(const std::string& name, const std::strin
mAvatarName->setToolTip(name);
}
-void LLAvatarListItem::onNameCache(const std::string& first_name, const std::string& last_name)
+void LLAvatarListItem::onNameCache(const std::string& fullname)
{
- std::string name = first_name + " " + last_name;
- setName(name);
+ setName(fullname);
}
// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years",
diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h
index 426d80e0a8..00c87ec330 100644
--- a/indra/newview/llavatarlistitem.h
+++ b/indra/newview/llavatarlistitem.h
@@ -151,7 +151,7 @@ private:
} EAvatarListItemChildIndex;
void setNameInternal(const std::string& name, const std::string& highlight);
- void onNameCache(const std::string& first_name, const std::string& last_name);
+ void onNameCache(const std::string& fullname);
std::string formatSeconds(U32 secs);
diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp
index 996139fccc..cbd9097dba 100644
--- a/indra/newview/llcallingcard.cpp
+++ b/indra/newview/llcallingcard.cpp
@@ -249,7 +249,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
using namespace std;
U32 new_buddy_count = 0;
- std::string first,last;
+ std::string full_name;
LLUUID agent_id;
for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr)
{
@@ -259,7 +259,8 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds)
{
++new_buddy_count;
mBuddyInfo[agent_id] = (*itr).second;
- gCacheName->getName(agent_id, first, last);
+ // IDEVO JAMESDEBUG is this necessary? name is unused?
+ gCacheName->getFullName(agent_id, full_name);
addChangedMask(LLFriendObserver::ADD, agent_id);
lldebugs << "Added buddy " << agent_id
<< ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline")
@@ -845,10 +846,8 @@ bool LLCollectProxyBuddies::operator()(const LLUUID& buddy_id, LLRelationship* b
bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy)
{
- gCacheName->getName(buddy_id, mFirst, mLast);
- std::ostringstream fullname;
- fullname << mFirst << " " << mLast;
- buddy_map_t::value_type value(fullname.str(), buddy_id);
+ gCacheName->getFullName(buddy_id, mFullName);
+ buddy_map_t::value_type value(mFullName, buddy_id);
if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION))
{
mMappable.insert(value);
@@ -858,10 +857,8 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship
bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy)
{
- gCacheName->getName(buddy_id, mFirst, mLast);
- std::ostringstream fullname;
- fullname << mFirst << " " << mLast;
- buddy_map_t::value_type value(fullname.str(), buddy_id);
+ gCacheName->getFullName(buddy_id, mFullName);
+ buddy_map_t::value_type value(mFullName, buddy_id);
if(buddy->isOnline())
{
mOnline.insert(value);
@@ -871,10 +868,8 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship*
bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy)
{
- gCacheName->getName(buddy_id, mFirst, mLast);
- std::ostringstream fullname;
- fullname << mFirst << " " << mLast;
- buddy_map_t::value_type value(fullname.str(), buddy_id);
+ gCacheName->getFullName(buddy_id, mFullName);
+ buddy_map_t::value_type value(mFullName, buddy_id);
if(buddy->isOnline())
{
mOnline.insert(value);
@@ -885,5 +880,3 @@ bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bud
}
return true;
}
-
-
diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h
index 47b0dcb903..5bd1f05687 100644
--- a/indra/newview/llcallingcard.h
+++ b/indra/newview/llcallingcard.h
@@ -241,8 +241,7 @@ public:
virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
buddy_map_t mMappable;
- std::string mFirst;
- std::string mLast;
+ std::string mFullName;
};
// collect dictionary sorted map of name -> agent_id for every online buddy
@@ -254,8 +253,7 @@ public:
virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy);
typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
buddy_map_t mOnline;
- std::string mFirst;
- std::string mLast;
+ std::string mFullName;
};
// collect dictionary sorted map of name -> agent_id for every buddy,
@@ -269,8 +267,7 @@ public:
typedef std::map<std::string, LLUUID, LLDictionaryLess> buddy_map_t;
buddy_map_t mOnline;
buddy_map_t mOffline;
- std::string mFirst;
- std::string mLast;
+ std::string mFullName;
};
#endif // LL_LLCALLINGCARD_H
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 7a5d8be84a..6004c9f309 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -176,11 +176,7 @@ public:
}
else if (level == "add")
{
- std::string name;
- name.assign(getFirstName());
- name.append(" ");
- name.append(getLastName());
-
+ std::string name = getFullName();
LLAvatarActions::requestFriendshipDialog(getAvatarId(), name);
}
else if (level == "remove")
@@ -250,15 +246,14 @@ public:
}
const LLUUID& getAvatarId () const { return mAvatarID;}
- const std::string& getFirstName() const { return mFirstName; }
- const std::string& getLastName () const { return mLastName; }
+ const std::string& getFullName() const { return mFullName; }
void setup(const LLChat& chat,const LLStyle::Params& style_params)
{
mAvatarID = chat.mFromID;
mSessionID = chat.mSessionID;
mSourceType = chat.mSourceType;
- gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4));
+ gCacheName->get(mAvatarID, false, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3));
if(chat.mFromID.isNull())
{
mSourceType = CHAT_SOURCE_SYSTEM;
@@ -294,7 +289,7 @@ public:
if(mSourceType != CHAT_SOURCE_AGENT)
icon->setValue(LLSD("OBJECT_Icon"));
else
- icon->setValue(chat.mFromID);
+ icon->setValue(chat.mFromID);
}
@@ -335,12 +330,11 @@ public:
LLPanel::draw();
}
- void nameUpdatedCallback(const LLUUID& id,const std::string& first,const std::string& last,BOOL is_group)
+ void nameUpdatedCallback(const LLUUID& id,const std::string& full_name, bool is_group)
{
if (id != mAvatarID)
return;
- mFirstName = first;
- mLastName = last;
+ mFullName = full_name;
}
protected:
static const S32 PADDING = 20;
@@ -425,8 +419,7 @@ protected:
LLUUID mAvatarID;
EChatSourceType mSourceType;
- std::string mFirstName;
- std::string mLastName;
+ std::string mFullName;
std::string mFrom;
LLUUID mSessionID;
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index a0b2de85f0..cb549e65c8 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"
@@ -420,7 +421,7 @@ void LLFloaterAvatarPicker::processAvatarPickerReply(LLMessageSystem* msg, void*
}
else
{
- avatar_name = first_name + " " + last_name;
+ avatar_name = LLCacheName::buildFullName(first_name, last_name);
search_results->setEnabled(TRUE);
found_one = TRUE;
}
diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp
index e925796526..9ccae43a92 100644
--- a/indra/newview/llfloaterbump.cpp
+++ b/indra/newview/llfloaterbump.cpp
@@ -89,7 +89,7 @@ void LLFloaterBump::onOpen(const LLSD& key)
void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
{
- if (mcd->mFirstName.empty() || list->getItemCount() >= 20)
+ if (mcd->mFullName.empty() || list->getItemCount() >= 20)
{
return;
}
@@ -127,8 +127,7 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd)
// All above action strings are in XML file
LLUIString text = getString(action);
text.setArg("[TIME]", timeStr);
- text.setArg("[FIRST]", mcd->mFirstName);
- text.setArg("[LAST]", mcd->mLastName);
+ text.setArg("[NAME]", mcd->mFullName);
LLSD row;
row["id"] = mcd->mPerp;
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 9b88923e7e..47678d1e82 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -182,9 +182,8 @@ public:
void updateNames();
// Name cache callback
void updateGroupName(const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name,
- BOOL is_group);
+ const std::string& name,
+ bool is_group);
void refreshUI();
@@ -801,9 +800,9 @@ void LLFloaterBuyLandUI::updateNames()
}
else if (parcelp->getIsGroupOwned())
{
- gCacheName->get(parcelp->getGroupID(), TRUE,
+ gCacheName->get(parcelp->getGroupID(), true,
boost::bind(&LLFloaterBuyLandUI::updateGroupName, this,
- _1, _2, _3, _4));
+ _1, _2, _3));
}
else
{
@@ -813,16 +812,15 @@ void LLFloaterBuyLandUI::updateNames()
}
void LLFloaterBuyLandUI::updateGroupName(const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name,
- BOOL is_group)
+ const std::string& name,
+ bool is_group)
{
LLParcel* parcelp = mParcel->getParcel();
if (parcelp
&& parcelp->getGroupID() == id)
{
// request is current
- mParcelSellerName = first_name;
+ mParcelSellerName = name;
}
}
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 26c6db9652..f09459d5db 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1363,10 +1363,9 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co
}
else
{
- std::string first, last;
- gCacheName->getName(owner_id, first, last);
- args["FIRST"] = first;
- args["LAST"] = last;
+ std::string full_name;
+ gCacheName->getFullName(owner_id, full_name);
+ args["NAME"] = full_name;
LLNotificationsUtil::add("OtherObjectsReturned", args);
}
send_return_objects_message(parcel->getLocalID(), RT_OWNER);
diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp
index 51364594e4..7dbcc9555c 100644
--- a/indra/newview/llfloaterpay.cpp
+++ b/indra/newview/llfloaterpay.cpp
@@ -47,6 +47,7 @@
#include "lllineeditor.h"
#include "llmutelist.h"
#include "llfloaterreporter.h"
+#include "llslurl.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
@@ -102,10 +103,6 @@ private:
static void onGive(void* data);
void give(S32 amount);
static void processPayPriceReply(LLMessageSystem* msg, void **userdata);
- void onCacheOwnerName(const LLUUID& owner_id,
- const std::string& firstname,
- const std::string& lastname,
- BOOL is_group);
void finishPayUI(const LLUUID& target_id, BOOL is_group);
protected:
@@ -427,33 +424,28 @@ void LLFloaterPay::payDirectly(money_callback callback,
void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group)
{
- gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3, _4));
-
- // Make sure the amount field has focus
-
- childSetFocus("amount", TRUE);
-
- LLLineEditor* amount = getChild<LLLineEditor>("amount");
- amount->selectAll();
- mTargetIsGroup = is_group;
-}
-
-void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id,
- const std::string& firstname,
- const std::string& lastname,
- BOOL is_group)
-{
+ // IDEVO
+ //gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3, _4));
+ std::string slurl;
if (is_group)
{
setTitle(getString("payee_group"));
+ slurl = LLSLURL::buildCommand("group", target_id, "inspect");
}
else
{
setTitle(getString("payee_resident"));
+ slurl = LLSLURL::buildCommand("agent", target_id, "inspect");
}
+ childSetText("payee_name", slurl);
- childSetTextArg("payee_name", "[FIRST]", firstname);
- childSetTextArg("payee_name", "[LAST]", lastname);
+ // Make sure the amount field has focus
+
+ childSetFocus("amount", TRUE);
+
+ LLLineEditor* amount = getChild<LLLineEditor>("amount");
+ amount->selectAll();
+ mTargetIsGroup = is_group;
}
// static
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/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index fdf128945e..2fce50007e 100644
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -563,11 +563,8 @@ void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::stri
// callback from the name cache with an owner name to add to the list
void LLPanelScriptLimitsRegionMemory::onNameCache(
const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name)
+ const std::string& name)
{
- std::string name = first_name + " " + last_name;
-
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list");
if(!list)
{
@@ -670,9 +667,12 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
if(std::find(names_requested.begin(), names_requested.end(), owner_id) == names_requested.end())
{
names_requested.push_back(owner_id);
- gCacheName->get(owner_id, TRUE,
+ // Is this a bug? It's trying to look up a GROUP name, not
+ // an AVATAR name? JC
+ const bool is_group = true;
+ gCacheName->get(owner_id, is_group,
boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache,
- this, _1, _2, _3));
+ this, _1, _2));
}
}
}
diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h
index 0cba4d72f2..ce49209039 100644
--- a/indra/newview/llfloaterscriptlimits.h
+++ b/indra/newview/llfloaterscriptlimits.h
@@ -173,10 +173,8 @@ public:
void returnObjects();
private:
-
void onNameCache(const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name);
+ const std::string& name);
LLSD mContent;
LLUUID mParcelId;
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 8ad94b957d..53fc176268 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -87,7 +87,6 @@ bool lltextobject_further_away::operator()(const LLPointer<LLHUDText>& lhs, cons
LLHUDText::LLHUDText(const U8 type) :
LLHUDObject(type),
mUseBubble(FALSE),
- mUsePixelSize(TRUE),
mVisibleOffScreen(FALSE),
mWidth(0.f),
mHeight(0.f),
@@ -679,11 +678,6 @@ void LLHUDText::setColor(const LLColor4 &color)
}
-void LLHUDText::setUsePixelSize(const BOOL use_pixel_size)
-{
- mUsePixelSize = use_pixel_size;
-}
-
void LLHUDText::setDoFade(const BOOL do_fade)
{
mDoFade = do_fade;
diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h
index dc14a8c764..5d88b5d6ab 100644
--- a/indra/newview/llhudtext.h
+++ b/indra/newview/llhudtext.h
@@ -99,7 +99,6 @@ public:
void setDropShadow(const BOOL do_shadow);
void setFont(const LLFontGL* font);
void setColor(const LLColor4 &color);
- void setUsePixelSize(const BOOL use_pixel_size);
void setZCompare(const BOOL zcompare);
void setDoFade(const BOOL do_fade);
void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; }
@@ -150,7 +149,6 @@ private:
F32 mFadeRange;
F32 mFadeDistance;
F32 mLastDistance;
- BOOL mUsePixelSize;
BOOL mZCompare;
BOOL mVisibleOffScreen;
BOOL mOffscreen;
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 5a6c6ebbee..8999aab50a 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -2450,7 +2450,8 @@ void LLIMMgr::inviteToSession(
{
if (caller_name.empty())
{
- gCacheName->get(caller_id, FALSE, boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3, _4));
+ gCacheName->get(caller_id, false,
+ boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3));
}
else
{
@@ -2460,9 +2461,9 @@ void LLIMMgr::inviteToSession(
}
}
-void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group)
+void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group)
{
- payload["caller_name"] = first + " " + last;
+ payload["caller_name"] = name;
payload["session_name"] = payload["caller_name"].asString();
std::string notify_box_type = payload["notify_box_type"].asString();
@@ -2677,13 +2678,12 @@ void LLIMMgr::noteOfflineUsers(
for(S32 i = 0; i < count; ++i)
{
info = at.getBuddyInfo(ids.get(i));
- std::string first, last;
+ std::string full_name;
if(info && !info->isOnline()
- && gCacheName->getName(ids.get(i), first, last))
+ && gCacheName->getFullName(ids.get(i), full_name))
{
LLUIString offline = LLTrans::getString("offline_message");
- offline.setArg("[FIRST]", first);
- offline.setArg("[LAST]", last);
+ offline.setArg("[NAME]", full_name);
im_model.proccessOnlineOfflineNotification(session_id, offline);
}
}
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index ad6cede727..a6c8394071 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -429,7 +429,7 @@ private:
void processIMTypingCore(const LLIMInfo* im_info, BOOL typing);
- static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
+ static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group);
void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id);
void notifyObserverSessionRemoved(const LLUUID& session_id);
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index b2cdc0738f..41dbeab5a7 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -138,11 +138,9 @@ private:
bool isNotFriend();
// Callback for gCacheName to look up avatar name
- void nameUpdatedCallback(
- const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group);
+ void onNameCache(const LLUUID& id,
+ const std::string& name,
+ bool is_group);
private:
LLUUID mAvatarID;
@@ -360,9 +358,9 @@ void LLInspectAvatar::requestUpdate()
childSetValue("avatar_icon", LLSD(mAvatarID) );
- gCacheName->get(mAvatarID, FALSE,
- boost::bind(&LLInspectAvatar::nameUpdatedCallback,
- this, _1, _2, _3, _4));
+ gCacheName->get(mAvatarID, false,
+ boost::bind(&LLInspectAvatar::onNameCache,
+ this, _1, _2, _3));
}
void LLInspectAvatar::processAvatarData(LLAvatarData* data)
@@ -603,16 +601,26 @@ void LLInspectAvatar::onVolumeChange(const LLSD& data)
gVoiceClient->setUserVolume(mAvatarID, volume);
}
-void LLInspectAvatar::nameUpdatedCallback(
+void LLInspectAvatar::onNameCache(
const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group)
+ const std::string& name,
+ bool is_group)
{
if (id == mAvatarID)
{
- mAvatarName = first + " " + last;
- childSetValue("user_name", LLSD(mAvatarName) );
+ mAvatarName = name;
+
+ // IDEVO JAMESDEBUG - need to always display a display name
+ std::string display_name;
+ if (gCacheName->getDisplayName(mAvatarID, display_name))
+ {
+ getChild<LLUICtrl>("user_name")->setValue(display_name);
+ }
+ else
+ {
+ getChild<LLUICtrl>("user_name")->setValue(name);
+ }
+ getChild<LLUICtrl>("user_slid")->setValue(name);
}
}
diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp
index 7fd7b69021..364da3f64c 100644
--- a/indra/newview/llinspectgroup.cpp
+++ b/indra/newview/llinspectgroup.cpp
@@ -84,9 +84,8 @@ public:
// Callback for gCacheName to look up group name
// Faster than waiting for group properties to return
void nameUpdatedCallback(const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group);
+ const std::string& name,
+ bool is_group);
// Button/menu callbacks
void onClickViewProfile();
@@ -225,21 +224,19 @@ void LLInspectGroup::requestUpdate()
mPropertiesRequest = new LLFetchGroupData(mGroupID, this);
// Name lookup will be faster out of cache, use that
- gCacheName->get(mGroupID, TRUE,
+ gCacheName->get(mGroupID, true,
boost::bind(&LLInspectGroup::nameUpdatedCallback,
- this, _1, _2, _3, _4));
+ this, _1, _2, _3));
}
void LLInspectGroup::nameUpdatedCallback(
const LLUUID& id,
- const std::string& first,
- const std::string& last,
- BOOL is_group)
+ const std::string& name,
+ bool is_group)
{
if (id == mGroupID)
{
- // group names are returned as a first name
- childSetValue("group_name", LLSD(first) );
+ childSetValue("group_name", LLSD(name) );
}
// Otherwise possibly a request for an older inspector, ignore it
diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp
index 66e4a1bf66..e91f68f0c9 100644
--- a/indra/newview/llinspectremoteobject.cpp
+++ b/indra/newview/llinspectremoteobject.cpp
@@ -66,7 +66,7 @@ public:
private:
void update();
- static void nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data);
+ void onNameCache(const LLUUID& id, const std::string& name, bool is_group);
private:
LLUUID mObjectID;
@@ -121,7 +121,8 @@ void LLInspectRemoteObject::onOpen(const LLSD& data)
mOwner = "";
if (gCacheName)
{
- gCacheName->get(mOwnerID, mGroupOwned, nameCallback, this);
+ gCacheName->get(mOwnerID, mGroupOwned,
+ boost::bind(&LLInspectRemoteObject::onNameCache, this, _1, _2, _3));
}
// update the inspector with the current object state
@@ -152,16 +153,10 @@ void LLInspectRemoteObject::onClickClose()
closeFloater();
}
-//static
-void LLInspectRemoteObject::nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data)
+void LLInspectRemoteObject::onNameCache(const LLUUID& id, const std::string& name, bool is_group)
{
- LLInspectRemoteObject *self = (LLInspectRemoteObject*)data;
- self->mOwner = first;
- if (!last.empty())
- {
- self->mOwner += " " + last;
- }
- self->update();
+ mOwner = name;
+ update();
}
void LLInspectRemoteObject::update()
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 7ec976604a..bf19aae34f 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -756,7 +756,8 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
new_item->setCreator(id);
std::string avatar_name;
// Fetch the currect name
- gCacheName->get(id, FALSE, boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), _1, _2, _3));
+ gCacheName->get(id, false,
+ boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), _1, _2, _3));
}
}
else if (new_item->getType() == LLAssetType::AT_GESTURE)
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp
index 2d3c4b187e..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;
}
@@ -443,7 +442,7 @@ void LLMuteList::updateRemove(const LLMute& mute)
gAgent.sendReliableMessage();
}
-void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, LLMuteList::EAutoReason reason)
+void notify_automute_callback(const LLUUID& agent_id, const std::string& full_name, bool is_group, LLMuteList::EAutoReason reason)
{
std::string notif_name;
switch (reason)
@@ -461,8 +460,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n
}
LLSD args;
- args["FIRST"] = first_name;
- args["LAST"] = last_name;
+ args["NAME"] = full_name;
LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD());
if (notif_ptr)
@@ -477,7 +475,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n
}
-BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name, const std::string& last_name)
+BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason)
{
BOOL removed = FALSE;
@@ -487,24 +485,17 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, co
removed = TRUE;
remove(automute);
- if (first_name.empty() && last_name.empty())
+ std::string full_name;
+ if (gCacheName->getFullName(agent_id, full_name))
{
- std::string cache_first, cache_last;
- if (gCacheName->getName(agent_id, cache_first, cache_last))
- {
- // name in cache, call callback directly
- notify_automute_callback(agent_id, cache_first, cache_last, FALSE, reason);
- }
- else
- {
- // not in cache, lookup name from cache
- gCacheName->get(agent_id, FALSE, boost::bind(&notify_automute_callback, _1, _2, _3, _4, reason));
- }
+ // name in cache, call callback directly
+ notify_automute_callback(agent_id, full_name, false, reason);
}
else
{
- // call callback directly
- notify_automute_callback(agent_id, first_name, last_name, FALSE, reason);
+ // not in cache, lookup name from cache
+ gCacheName->get(agent_id, false,
+ boost::bind(&notify_automute_callback, _1, _2, _3, reason));
}
}
diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h
index e1e81a24b4..4e5812c5ff 100644
--- a/indra/newview/llmutelist.h
+++ b/indra/newview/llmutelist.h
@@ -107,7 +107,7 @@ public:
// Remove both normal and legacy mutes, for any or all properties.
BOOL remove(const LLMute& mute, U32 flags = 0);
- BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name = LLStringUtil::null, const std::string& last_name = LLStringUtil::null);
+ BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason);
// Name is required to test against legacy text-only mutes.
BOOL isMuted(const LLUUID& id, const std::string& name = LLStringUtil::null, U32 flags = 0) const;
diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp
index cd810b9793..da3e95e947 100644
--- a/indra/newview/llnamebox.cpp
+++ b/indra/newview/llnamebox.cpp
@@ -87,26 +87,15 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group)
setText(mInitialValue);
}
-void LLNameBox::refresh(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group)
+void LLNameBox::refresh(const LLUUID& id, const std::string& full_name, bool is_group)
{
if (id == mNameID)
{
- std::string name;
- if (!is_group)
- {
- name = firstname + " " + lastname;
- }
- else
- {
- name = firstname;
- }
- setName(name, is_group);
+ setName(full_name, is_group);
}
}
-void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group)
+void LLNameBox::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group)
{
std::set<LLNameBox*>::iterator it;
for (it = LLNameBox::sInstances.begin();
@@ -114,7 +103,7 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname,
++it)
{
LLNameBox* box = *it;
- box->refresh(id, firstname, lastname, is_group);
+ box->refresh(id, full_name, is_group);
}
}
diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h
index 48b54faec8..2fe8990653 100644
--- a/indra/newview/llnamebox.h
+++ b/indra/newview/llnamebox.h
@@ -59,10 +59,9 @@ public:
void setNameID(const LLUUID& name_id, BOOL is_group);
- void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
+ void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
- static void refreshAll(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group);
+ static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
protected:
LLNameBox (const Params&);
diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp
index 65601da7da..0c704a1f56 100644
--- a/indra/newview/llnameeditor.cpp
+++ b/indra/newview/llnameeditor.cpp
@@ -81,26 +81,15 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group)
setText(name);
}
-void LLNameEditor::refresh(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group)
+void LLNameEditor::refresh(const LLUUID& id, const std::string& full_name, bool is_group)
{
if (id == mNameID)
{
- std::string name;
- if (!is_group)
- {
- name = firstname + " " + lastname;
- }
- else
- {
- name = firstname;
- }
- setText(name);
+ setText(full_name);
}
}
-void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group)
+void LLNameEditor::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group)
{
std::set<LLNameEditor*>::iterator it;
for (it = LLNameEditor::sInstances.begin();
@@ -108,7 +97,7 @@ void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname,
++it)
{
LLNameEditor* box = *it;
- box->refresh(id, firstname, lastname, is_group);
+ box->refresh(id, full_name, is_group);
}
}
diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h
index 99e03a1166..a75c492aca 100644
--- a/indra/newview/llnameeditor.h
+++ b/indra/newview/llnameeditor.h
@@ -65,10 +65,9 @@ public:
void setNameID(const LLUUID& name_id, BOOL is_group);
- void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
+ void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
- static void refreshAll(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group);
+ static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
// Take/return agent UUIDs
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 114fef8712..5058939b0a 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -316,22 +316,11 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id)
}
// public
-void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first,
- const std::string& last, BOOL is_group)
+void LLNameListCtrl::refresh(const LLUUID& id, const std::string& full_name, bool is_group)
{
//llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " "
// << last << "'" << llendl;
- std::string fullname;
- if (!is_group)
- {
- fullname = first + " " + last;
- }
- else
- {
- fullname = first;
- }
-
// TODO: scan items for that ID, fix if necessary
item_list::iterator iter;
for (iter = getItemList().begin(); iter != getItemList().end(); iter++)
@@ -342,7 +331,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first,
LLScrollListCell* cell = item->getColumn(mNameColumnIndex);
if (cell)
{
- cell->setValue(fullname);
+ cell->setValue(full_name);
}
}
}
@@ -352,15 +341,14 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first,
// static
-void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first,
- const std::string& last, BOOL is_group)
+void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group)
{
LLInstanceTrackerScopedGuard guard;
LLInstanceTracker<LLNameListCtrl>::instance_iter it;
for (it = guard.beginInstances(); it != guard.endInstances(); ++it)
{
LLNameListCtrl& ctrl = *it;
- ctrl.refresh(id, first, last, is_group);
+ ctrl.refresh(id, full_name, is_group);
}
}
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 23b1cb6897..5148c74132 100644
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -105,10 +105,9 @@ public:
void removeNameItem(const LLUUID& agent_id);
- void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
+ void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
- static void refreshAll(const LLUUID& id, const std::string& firstname,
- const std::string& lastname, BOOL is_group);
+ static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
// LLView interface
/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp
index b8e0892b02..4d1a8fcb04 100644
--- a/indra/newview/llnotificationhandlerutil.cpp
+++ b/indra/newview/llnotificationhandlerutil.cpp
@@ -45,8 +45,8 @@ using namespace LLNotificationsUI;
const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"),
REVOKED_MODIFY_RIGHTS("RevokedModifyRights"), OBJECT_GIVE_ITEM(
- "ObjectGiveItem"), OBJECT_GIVE_ITEM_UNKNOWN_USER(
- "ObjectGiveItemUnknownUser"), PAYMENT_RECIVED("PaymentRecived"),
+ "ObjectGiveItem"),
+ PAYMENT_RECIVED("PaymentRecived"),
ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"),
USER_GIVE_ITEM("UserGiveItem"),
INVENTORY_ACCEPTED("InventoryAccepted"),
@@ -157,8 +157,7 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
"SESSION_NAME") ? notification->getPayload()["SESSION_NAME"].asString() : name;
// don't create IM p2p session with objects, it's necessary condition to log
- if (notification->getName() != OBJECT_GIVE_ITEM && notification->getName()
- != OBJECT_GIVE_ITEM_UNKNOWN_USER)
+ if (notification->getName() != OBJECT_GIVE_ITEM)
{
LLUUID from_id = notification->getPayload()["from_id"];
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index d7c558d188..1cc16a14bb 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -225,12 +225,11 @@ void LLPanelAvatarNotes::rightsConfirmationCallback(const LLSD& notification,
void LLPanelAvatarNotes::confirmModifyRights(bool grant, S32 rights)
{
- std::string first, last;
+ std::string full_name;
LLSD args;
- if (gCacheName->getName(getAvatarId(), first, last))
+ if (gCacheName->getFullName(getAvatarId(), full_name))
{
- args["FIRST_NAME"] = first;
- args["LAST_NAME"] = last;
+ args["NAME"] = full_name;
}
if (grant)
diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp
index 7563cc7f61..173fb851ce 100644
--- a/indra/newview/llpanelavatartag.cpp
+++ b/indra/newview/llpanelavatartag.cpp
@@ -86,7 +86,7 @@ void LLPanelAvatarTag::setAvatarId(const LLUUID& avatar_id)
{
mIcon->setValue(avatar_id);
}
- setName(std::string(mIcon->getFirstName()+ " "+ mIcon->getLastName()));
+ setName(std::string(mIcon->getFullName()));
}
boost::signals2::connection LLPanelAvatarTag::setLeftButtonClickCallback(
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/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 8e305a5674..15e8258475 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -182,7 +182,7 @@ void LLPanelIMControlPanel::onViewProfileButtonClicked()
void LLPanelIMControlPanel::onAddFriendButtonClicked()
{
LLAvatarIconCtrl* avatar_icon = getChild<LLAvatarIconCtrl>("avatar_icon");
- std::string full_name = avatar_icon->getFirstName() + " " + avatar_icon->getLastName();
+ std::string full_name = avatar_icon->getFullName();
LLAvatarActions::requestFriendshipDialog(mAvatarID, full_name);
}
@@ -224,6 +224,15 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id)
childSetEnabled("share_btn", FALSE);
childSetEnabled("teleport_btn", FALSE);
childSetEnabled("pay_btn", FALSE);
+
+ getChild<LLTextBox>("avatar_name")->setValue(im_session->mName);
+ getChild<LLTextBox>("avatar_name")->setToolTip(im_session->mName);
+ }
+ else
+ {
+ // If the participant is an avatar, fetch the currect name
+ gCacheName->get(mAvatarID, false,
+ boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3));
}
}
@@ -239,6 +248,16 @@ void LLPanelIMControlPanel::changed(U32 mask)
}
}
+void LLPanelIMControlPanel::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group)
+{
+ if ( id == mAvatarID )
+ {
+ std::string avatar_name = full_name;
+ getChild<LLTextBox>("avatar_name")->setValue(avatar_name);
+ getChild<LLTextBox>("avatar_name")->setToolTip(avatar_name);
+ }
+}
+
LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id):
mParticipantList(NULL)
{
diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h
index ce8fc58e56..45f4b95903 100644
--- a/indra/newview/llpanelimcontrolpanel.h
+++ b/indra/newview/llpanelimcontrolpanel.h
@@ -89,6 +89,9 @@ public:
// LLFriendObserver trigger
virtual void changed(U32 mask);
+protected:
+ void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group);
+
private:
void onViewProfileButtonClicked();
void onAddFriendButtonClicked();
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index cd6c727b5c..3f292dc416 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -44,6 +44,7 @@
#include "llagent.h"
#include "llagentui.h"
#include "lllandmarkactions.h"
+#include "llslurl.h"
#include "llviewerinventory.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
@@ -230,13 +231,15 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem)
//////////////////
if (pItem->getCreatorUUID().notNull())
{
- std::string name;
+ // IDEVO
LLUUID creator_id = pItem->getCreatorUUID();
- if (!gCacheName->getFullName(creator_id, name))
- {
- gCacheName->get(creator_id, FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3));
- }
+ std::string name =
+ LLSLURL::buildCommand("agent", creator_id, "inspect");
+ //if (!gCacheName->getFullName(creator_id, name))
+ //{
+ // gCacheName->get(creator_id, FALSE,
+ // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3));
+ //}
mCreator->setText(name);
}
else
@@ -253,20 +256,24 @@ void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem)
if (perm.isGroupOwned())
{
LLUUID group_id = perm.getGroup();
- if (!gCacheName->getGroupName(group_id, name))
- {
- gCacheName->get(group_id, TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3));
- }
+ // IDEVO
+ //if (!gCacheName->getGroupName(group_id, name))
+ //{
+ // gCacheName->get(group_id, TRUE,
+ // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3));
+ //}
+ name = LLSLURL::buildCommand("group", group_id, "inspect");
}
else
{
LLUUID owner_id = perm.getOwner();
- if (!gCacheName->getFullName(owner_id, name))
- {
- gCacheName->get(owner_id, FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3));
- }
+ // IDEVO
+ //if (!gCacheName->getFullName(owner_id, name))
+ //{
+ // gCacheName->get(owner_id, FALSE,
+ // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3));
+ //}
+ name = LLSLURL::buildCommand("agent", owner_id, "inspect");
}
mOwner->setText(name);
}
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 43f4024bac..04fefe5874 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -213,7 +213,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
}
#if !USE_VIEWER_AUTH
- childSetPrevalidate("first_name_edit", LLTextValidate::validateASCIIPrintableNoSpace);
+ //childSetPrevalidate("login_id_edit", LLTextValidate::validateASCIIPrintableNoSpace);
childSetPrevalidate("last_name_edit", LLTextValidate::validateASCIIPrintableNoSpace);
childSetCommitCallback("password_edit", mungePassword, this);
@@ -498,7 +498,7 @@ void LLPanelLogin::giveFocus()
if( sInstance )
{
// Grab focus and move cursor to first blank input field
- std::string first = sInstance->childGetText("first_name_edit");
+ std::string first = sInstance->childGetText("login_id_edit");
std::string pass = sInstance->childGetText("password_edit");
BOOL have_first = !first.empty();
@@ -514,7 +514,7 @@ void LLPanelLogin::giveFocus()
else
{
// User doesn't have a name, so start there.
- edit = sInstance->getChild<LLLineEditor>("first_name_edit");
+ edit = sInstance->getChild<LLLineEditor>("login_id_edit");
}
if (edit)
@@ -536,8 +536,8 @@ void LLPanelLogin::showLoginWidgets()
// *TODO: Append all the usual login parameters, like first_login=Y etc.
std::string splash_screen_url = sInstance->getString("real_url");
web_browser->navigateTo( splash_screen_url, "text/html" );
- LLUICtrl* first_name_edit = sInstance->getChild<LLUICtrl>("first_name_edit");
- first_name_edit->setFocus(TRUE);
+ LLUICtrl* login_id_edit = sInstance->getChild<LLUICtrl>("login_id_edit");
+ login_id_edit->setFocus(TRUE);
}
// static
@@ -569,8 +569,15 @@ void LLPanelLogin::setFields(const std::string& firstname,
return;
}
- sInstance->childSetText("first_name_edit", firstname);
- sInstance->childSetText("last_name_edit", lastname);
+ std::string login_id = firstname;
+ if (!lastname.empty() && lastname != "Resident")
+ {
+ // support traditional First Last name slurls
+ login_id += " ";
+ login_id += lastname;
+ }
+ sInstance->childSetText("login_id_edit", login_id);
+ sInstance->childSetText("last_name_edit", std::string());
// Max "actual" password length is 16 characters.
// Hex digests are always 32 characters.
@@ -623,10 +630,24 @@ void LLPanelLogin::getFields(std::string *firstname,
return;
}
- *firstname = sInstance->childGetText("first_name_edit");
- LLStringUtil::trim(*firstname);
+ std::string login_id = sInstance->childGetText("login_id_edit");
+ LLStringUtil::trim(login_id);
- *lastname = sInstance->childGetText("last_name_edit");
+ U32 pos = login_id.find(' ');
+ if (pos != std::string::npos)
+ {
+ // old-style Firstname Lastname
+ *firstname = login_id.substr(0, pos);
+ *lastname = login_id.substr(pos+1);
+ }
+ else
+ {
+ // new-style single SLID string
+ *firstname = login_id;
+ *lastname = "Resident";
+ }
+
+ LLStringUtil::trim(*firstname);
LLStringUtil::trim(*lastname);
*password = sInstance->mMungedPassword;
@@ -911,8 +932,10 @@ void LLPanelLogin::onClickConnect(void *)
// JC - Make sure the fields all get committed.
sInstance->setFocus(FALSE);
- std::string first = sInstance->childGetText("first_name_edit");
- std::string last = sInstance->childGetText("last_name_edit");
+ // Do SLID "Resident" name mangling
+ std::string first, last, unused_password;
+ getFields(&first, &last, &unused_password);
+
LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo");
std::string combo_text = combo->getSimple();
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
index 3504cbd1ef..77a2ac3a8c 100644
--- a/indra/newview/llpanelme.cpp
+++ b/indra/newview/llpanelme.cpp
@@ -221,13 +221,13 @@ void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_d
childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH));
- std::string first, last;
- BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last);
- if (found)
- {
- childSetTextArg("name_text", "[FIRST]", first);
- childSetTextArg("name_text", "[LAST]", last);
- }
+ // IDEVO - These fields do not seem to exist any more.
+ //std::string full_name;
+ //BOOL found = gCacheName->getFullName(avatar_data->avatar_id, full_name);
+ //if (found)
+ //{
+ // childSetTextArg("name_text", "[NAME]", full_name);
+ //}
}
BOOL LLPanelMyProfileEdit::postBuild()
diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp
index e5caaaaffc..227dbb3da7 100644
--- a/indra/newview/llpanelmediasettingspermissions.cpp
+++ b/indra/newview/llpanelmediasettingspermissions.cpp
@@ -115,7 +115,7 @@ void LLPanelMediaSettingsPermissions::draw()
if(mPermsGroupName)
{
mPermsGroupName->setNameID(LLUUID::null, TRUE);
- mPermsGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, true);
+ mPermsGroupName->refresh(LLUUID::null, std::string(), true);
mPermsGroupName->setEnabled(false);
};
};
@@ -194,7 +194,7 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me
data_set[ i ].ctrl_ptr->setTentative( media_settings[ tentative_key ].asBoolean() );
};
};
-
+
// *NOTE: If any of a particular flavor is tentative, we have to disable
// them all because of an architectural issue: namely that we represent
// these as a bit field, and we can't selectively apply only one bit to all selected
@@ -238,21 +238,21 @@ void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in, bool include_
{
// moved over from the 'General settings' tab
if (include_tentative || !mControls->getTentative()) fill_me_in[LLMediaEntry::CONTROLS_KEY] = (LLSD::Integer)mControls->getCurrentIndex();
-
- // *NOTE: For some reason, gcc does not like these symbol references in the
- // expressions below (inside the static_casts). I have NO idea why :(.
- // For some reason, assigning them to const temp vars here fixes the link
- // error. Bizarre.
- const U8 none = LLMediaEntry::PERM_NONE;
- const U8 owner = LLMediaEntry::PERM_OWNER;
- const U8 group = LLMediaEntry::PERM_GROUP;
- const U8 anyone = LLMediaEntry::PERM_ANYONE;
- const LLSD::Integer control = static_cast<LLSD::Integer>(
+
+ // *NOTE: For some reason, gcc does not like these symbol references in the
+ // expressions below (inside the static_casts). I have NO idea why :(.
+ // For some reason, assigning them to const temp vars here fixes the link
+ // error. Bizarre.
+ const U8 none = LLMediaEntry::PERM_NONE;
+ const U8 owner = LLMediaEntry::PERM_OWNER;
+ const U8 group = LLMediaEntry::PERM_GROUP;
+ const U8 anyone = LLMediaEntry::PERM_ANYONE;
+ const LLSD::Integer control = static_cast<LLSD::Integer>(
(mPermsOwnerControl->getValue() ? owner : none ) |
(mPermsGroupControl->getValue() ? group: none ) |
(mPermsWorldControl->getValue() ? anyone : none ));
- const LLSD::Integer interact = static_cast<LLSD::Integer>(
- (mPermsOwnerInteract->getValue() ? owner: none ) |
+ const LLSD::Integer interact = static_cast<LLSD::Integer>(
+ (mPermsOwnerInteract->getValue() ? owner: none ) |
(mPermsGroupInteract->getValue() ? group : none ) |
(mPermsWorldInteract->getValue() ? anyone : none ));
@@ -266,15 +266,15 @@ void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in, bool include_
!mPermsGroupControl->getTentative() ||
!mPermsWorldControl->getTentative())
{
- fill_me_in[LLMediaEntry::PERMS_CONTROL_KEY] = control;
+ fill_me_in[LLMediaEntry::PERMS_CONTROL_KEY] = control;
}
if (include_tentative ||
!mPermsOwnerInteract->getTentative() ||
!mPermsGroupInteract->getTentative() ||
!mPermsWorldInteract->getTentative())
{
- fill_me_in[LLMediaEntry::PERMS_INTERACT_KEY] = interact;
- }
+ fill_me_in[LLMediaEntry::PERMS_INTERACT_KEY] = interact;
+}
}
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 01b6e8ffad..78a0a5cfac 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -385,7 +385,7 @@ void LLPanelPermissions::refresh()
if (mLabelGroupName)
{
mLabelGroupName->setNameID(LLUUID::null, TRUE);
- mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE);
+ mLabelGroupName->refresh(LLUUID::null, std::string(), true);
mLabelGroupName->setEnabled(FALSE);
}
}
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 8eb0b69491..c867a2c64b 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -265,9 +265,9 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
LLAvatarPicks* avatar_picks = static_cast<LLAvatarPicks*>(data);
if(avatar_picks && getAvatarId() == avatar_picks->target_id)
{
- std::string name, second_name;
- gCacheName->getName(getAvatarId(),name,second_name);
- childSetTextArg("pick_title", "[NAME]",name);
+ std::string full_name;
+ gCacheName->getFullName(getAvatarId(), full_name);
+ childSetTextArg("pick_title", "[NAME]", full_name);
// Save selection, to be able to edit same item after saving changes. See EXT-3023.
LLUUID selected_id = mPicksList->getSelectedValue()[PICK_ID];
@@ -846,13 +846,13 @@ void LLPanelPicks::onPanelClassifiedClose(LLPanelClassifiedInfo* panel)
llassert(c_item);
if (c_item)
{
- c_item->setClassifiedName(panel->getClassifiedName());
- c_item->setDescription(panel->getDescription());
- c_item->setSnapshotId(panel->getSnapshotId());
- }
+ c_item->setClassifiedName(panel->getClassifiedName());
+ c_item->setDescription(panel->getDescription());
+ c_item->setSnapshotId(panel->getSnapshotId());
}
}
}
+ }
onPanelPickClose(panel);
updateButtons();
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 9ebc8ca2b9..f57aa7d42e 100644
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -281,9 +281,7 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global, LLPanelPickEdit*
}
// static
-void LLPanelPlaceInfo::nameUpdatedCallback(LLTextBox* text,
- const std::string& first,
- const std::string& last)
+void LLPanelPlaceInfo::onNameCache(LLTextBox* text, const std::string& full_name)
{
- text->setText(first + " " + last);
+ text->setText(full_name);
}
diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h
index deedbd2b0f..0d7a09b5de 100644
--- a/indra/newview/llpanelplaceinfo.h
+++ b/indra/newview/llpanelplaceinfo.h
@@ -102,9 +102,7 @@ public:
void createPick(const LLVector3d& pos_global, LLPanelPickEdit* pick_panel);
protected:
- static void nameUpdatedCallback(LLTextBox* text,
- const std::string& first,
- const std::string& last);
+ static void onNameCache(LLTextBox* text, const std::string& full_name);
/**
* mParcelID is valid only for remote places, in other cases it's null. See resetLocation()
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index 9e5f9da0ea..5fe24b15f6 100644
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -51,6 +51,7 @@
#include "llappviewer.h"
#include "llcallbacklist.h"
#include "llfloaterbuycurrency.h"
+#include "llslurl.h" // IDEVO
#include "llstatusbar.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
@@ -427,11 +428,11 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
if(!parcel->getGroupID().isNull())
{
// FIXME: Using parcel group as region group.
- gCacheName->get(parcel->getGroupID(), TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionGroupText, _2, _3));
+ gCacheName->get(parcel->getGroupID(), true,
+ boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2));
- gCacheName->get(parcel->getGroupID(), TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3));
+ gCacheName->get(parcel->getGroupID(), true,
+ boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2));
}
else
{
@@ -443,10 +444,14 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
else
{
// Figure out the owner's name
- gCacheName->get(parcel->getOwnerID(), FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3));
- gCacheName->get(region->getOwner(), FALSE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mRegionOwnerText, _2, _3));
+ // IDEVO
+ //gCacheName->get(parcel->getOwnerID(), FALSE,
+ // boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mParcelOwner, _2, _3));
+ std::string parcel_owner =
+ LLSLURL::buildCommand("agent", parcel->getOwnerID(), "inspect");
+ mParcelOwner->setText(parcel_owner);
+ gCacheName->get(region->getOwner(), false,
+ boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionOwnerText, _2));
}
if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus())
@@ -468,8 +473,8 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID();
if(auth_buyer_id.notNull())
{
- gCacheName->get(auth_buyer_id, TRUE,
- boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mSaleToText, _2, _3));
+ gCacheName->get(auth_buyer_id, true,
+ boost::bind(&LLPanelPlaceInfo::onNameCache, mSaleToText, _2));
// Show sales info to a specific person or a group he belongs to.
if (auth_buyer_id != gAgent.getID() && !gAgent.isInGroup(auth_buyer_id))
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
index 044036ea50..7c9b7aed36 100644
--- a/indra/newview/llpanelprofileview.cpp
+++ b/indra/newview/llpanelprofileview.cpp
@@ -107,8 +107,8 @@ void LLPanelProfileView::onOpen(const LLSD& key)
}
// Update the avatar name.
- gCacheName->get(getAvatarId(), FALSE,
- boost::bind(&LLPanelProfileView::onAvatarNameCached, this, _1, _2, _3, _4));
+ gCacheName->get(getAvatarId(), false,
+ boost::bind(&LLPanelProfileView::onNameCache, this, _1, _2, _3));
updateOnlineStatus();
@@ -198,10 +198,10 @@ void LLPanelProfileView::processOnlineStatus(bool online)
mStatusText->setValue(status);
}
-void LLPanelProfileView::onAvatarNameCached(const LLUUID& id, const std::string& first_name, const std::string& last_name, BOOL is_group)
+void LLPanelProfileView::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group)
{
llassert(getAvatarId() == id);
- getChild<LLUICtrl>("user_name", FALSE)->setValue(first_name + " " + last_name);
+ getChild<LLUICtrl>("user_name", FALSE)->setValue(full_name);
}
// EOF
diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h
index 9b87e146a8..2b67be12e5 100644
--- a/indra/newview/llpanelprofileview.h
+++ b/indra/newview/llpanelprofileview.h
@@ -99,11 +99,10 @@ protected:
private:
// LLCacheName will call this function when avatar name is loaded from server.
// This is required to display names that have not been cached yet.
- void onAvatarNameCached(
+ void onNameCache(
const LLUUID& id,
- const std::string& first_name,
- const std::string& last_name,
- BOOL is_group);
+ const std::string& full_name,
+ bool is_group);
LLTextBox* mStatusText;
AvatarStatusObserver* mAvatarStatusObserver;
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 0630981d7e..b0cdbe74dd 100644
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -348,7 +348,7 @@ void LLSidepanelTaskInfo::refresh()
if (mLabelGroupName)
{
mLabelGroupName->setNameID(LLUUID::null, TRUE);
- mLabelGroupName->refresh(LLUUID::null,LLStringUtil::null, LLStringUtil::null, TRUE);
+ mLabelGroupName->refresh(LLUUID::null, std::string(), true);
mLabelGroupName->setEnabled(FALSE);
}
}
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 717a8bda1e..4e121021fc 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -75,12 +75,13 @@ LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerTy
void LLSpeaker::lookupName()
{
- gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4));
+ gCacheName->get(mID, false,
+ boost::bind(&LLSpeaker::onNameCache, this, _1, _2, _3));
}
-void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group)
+void LLSpeaker::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group)
{
- mDisplayName = first + " " + last;
+ mDisplayName = full_name;
}
bool LLSpeaker::isInVoiceChannel()
diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h
index b924fb2f2c..8c9e85dd14 100644
--- a/indra/newview/llspeakers.h
+++ b/indra/newview/llspeakers.h
@@ -66,7 +66,7 @@ public:
~LLSpeaker() {};
void lookupName();
- void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
+ void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group);
bool isInVoiceChannel();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index d1b91df6e9..cfad29df89 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -268,11 +268,11 @@ void apply_udp_blacklist(const std::string& csv);
bool process_login_success_response();
void transition_back_to_login_panel(const std::string& emsg);
-void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group)
+void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group)
{
- LLNameListCtrl::refreshAll(id, firstname, lastname, is_group);
- LLNameBox::refreshAll(id, firstname, lastname, is_group);
- LLNameEditor::refreshAll(id, firstname, lastname, is_group);
+ LLNameListCtrl::refreshAll(id, full_name, is_group);
+ LLNameBox::refreshAll(id, full_name, is_group);
+ LLNameEditor::refreshAll(id, full_name, is_group);
// TODO: Actually be intelligent about the refresh.
// For now, just brute force refresh the dialogs.
@@ -1890,7 +1890,7 @@ bool idle_startup()
LLViewerShaderMgr::instance()->setShaders();
}
}
-
+
// If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account)
// then auto-populate outfits from the library into the My Outfits folder.
static bool check_populate_my_outfits = true;
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index fdf9e1df2e..4a61bed475 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;
+ // IDEVO JAMESDEBUG try to get display name + SLID
+ std::string final_name;
+ std::string full_name;
+ if (!gCacheName->getFullName(hover_object->getID(), full_name))
+ {
LLNameValue* firstname = hover_object->getNVPair("FirstName");
LLNameValue* lastname = hover_object->getNVPair("LastName");
if (firstname && lastname)
{
- avatar_name = llformat("%s %s", firstname->getString(), lastname->getString());
+ 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/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 3001992630..81b5ac81ad 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1544,9 +1544,9 @@ bool LLViewerInventoryItem::checkPermissionsSet(PermissionMask mask) const
//----------
-void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name)
+void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group)
{
- rename(first_name + " " + last_name);
+ rename(name);
gInventory.addChangedMask(LLInventoryObserver::LABEL, getUUID());
gInventory.notifyObservers();
}
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index c24f76c87a..278786796d 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -159,7 +159,7 @@ public:
bool checkPermissionsSet(PermissionMask mask) const;
// callback
- void onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name);
+ void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group);
// If this is a broken link, try to fix it and any other identical link.
BOOL regenerateLink();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index af89df448d..7fc7f2101a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2766,9 +2766,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;
@@ -3114,58 +3113,6 @@ bool enable_freeze_eject(const LLSD& avatar_id)
return new_value;
}
-class LLAvatarGiveCard : public view_listener_t
-{
- bool handleEvent(const LLSD& userdata)
- {
- llinfos << "handle_give_card()" << llendl;
- LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
- if(dest && dest->isAvatar())
- {
- bool found_name = false;
- LLSD args;
- LLSD old_args;
- LLNameValue* nvfirst = dest->getNVPair("FirstName");
- LLNameValue* nvlast = dest->getNVPair("LastName");
- if(nvfirst && nvlast)
- {
- args["FIRST"] = nvfirst->getString();
- args["LAST"] = nvlast->getString();
- old_args["FIRST"] = nvfirst->getString();
- old_args["LAST"] = nvlast->getString();
- found_name = true;
- }
- LLViewerRegion* region = dest->getRegion();
- LLHost dest_host;
- if(region)
- {
- dest_host = region->getHost();
- }
- if(found_name && dest_host.isOk())
- {
- LLMessageSystem* msg = gMessageSystem;
- msg->newMessage("OfferCallingCard");
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
- msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
- msg->nextBlockFast(_PREHASH_AgentBlock);
- msg->addUUIDFast(_PREHASH_DestID, dest->getID());
- LLUUID transaction_id;
- transaction_id.generate();
- msg->addUUIDFast(_PREHASH_TransactionID, transaction_id);
- msg->sendReliable(dest_host);
- LLNotificationsUtil::add("OfferedCard", args);
- }
- else
- {
- LLNotificationsUtil::add("CantOfferCallingCard", old_args);
- }
- }
- return true;
- }
-};
-
-
void login_done(S32 which, void *user)
{
@@ -3577,21 +3524,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
{
@@ -5357,14 +5300,14 @@ void handle_look_at_selection(const LLSD& param)
distance = llmin(distance, (F32) orig_distance.length());
gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
- LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
- object_id );
+ LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
+ object_id );
}
else
{
gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id );
- }
+ }
}
}
@@ -7951,7 +7894,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLAvatarDebug(), "Avatar.Debug");
view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug");
view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup");
- view_listener_t::addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard");
commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD()));
view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM");
view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call");
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 8aa642bdb6..10d5d002cd 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -921,7 +921,7 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f
// TODO* LLPanelPlaces dependency is going to be removed. See EXT-4347.
//if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem())
//{
- // places_panel->setItem(item);
+ //places_panel->setItem(item);
//}
//else
// we are opening a group notice attachment
@@ -1001,27 +1001,24 @@ bool highlight_offered_item(const LLUUID& item_id)
}
void inventory_offer_mute_callback(const LLUUID& blocked_id,
- const std::string& first_name,
- const std::string& last_name,
- BOOL is_group, LLOfferInfo* offer = NULL)
+ const std::string& full_name,
+ bool is_group,
+ LLOfferInfo* offer = NULL)
{
- std::string from_name;
+ std::string from_name = full_name;
LLMute::EType type;
if (is_group)
{
type = LLMute::GROUP;
- from_name = first_name;
}
else if(offer && offer->mFromObject)
{
//we have to block object by name because blocked_id is an id of owner
type = LLMute::BY_NAME;
- from_name = offer->mFromName;
}
else
{
type = LLMute::AGENT;
- from_name = first_name + " " + last_name;
}
// id should be null for BY_NAME mute, see LLMuteList::add for details
@@ -1039,7 +1036,6 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id,
bool matches(const LLNotificationPtr notification) const
{
if(notification->getName() == "ObjectGiveItem"
- || notification->getName() == "ObjectGiveItemUnknownUser"
|| notification->getName() == "UserGiveItem")
{
return (notification->getPayload()["from_id"].asUUID() == blocked_id);
@@ -1147,7 +1143,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// * we can't build two messages at once.
if (2 == button) // Block
{
- gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this));
+ gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,this));
}
std::string from_string; // Used in the pop-up.
@@ -1284,7 +1280,7 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
// * we can't build two messages at once.
if (2 == button)
{
- gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this));
+ gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,this));
}
LLMessageSystem* msg = gMessageSystem;
@@ -1332,12 +1328,12 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const
}
else
{
- std::string first_name, last_name;
- if (gCacheName->getName(mFromID, first_name, last_name))
+ std::string full_name;
+ if (gCacheName->getFullName(mFromID, full_name))
{
from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName
- + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + first_name + " " + last_name;
- chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + first_name + " " + last_name;
+ + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + full_name;
+ chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + full_name;
}
else
{
@@ -1501,30 +1497,6 @@ void inventory_offer_handler(LLOfferInfo* info)
return;
}
- // Name cache callbacks don't store userdata, so can't save
- // off the LLOfferInfo. Argh.
- BOOL name_found = FALSE;
- if (info->mFromGroup)
- {
- std::string group_name;
- if (gCacheName->getGroupName(info->mFromID, group_name))
- {
- args["FIRST"] = group_name;
- args["LAST"] = "";
- name_found = TRUE;
- }
- }
- else
- {
- std::string first_name, last_name;
- if (gCacheName->getName(info->mFromID, first_name, last_name))
- {
- args["FIRST"] = first_name;
- args["LAST"] = last_name;
- name_found = TRUE;
- }
- }
-
// If mObjectID is null then generate the object_id based on msg to prevent
// multiple creation of chiclets for same object.
LLUUID object_id = info->mObjectID;
@@ -1539,7 +1511,14 @@ void inventory_offer_handler(LLOfferInfo* info)
payload["give_inventory_notification"] = FALSE;
args["OBJECTFROMNAME"] = info->mFromName;
args["NAME"] = info->mFromName;
- args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about");
+ if (info->mFromGroup)
+ {
+ args["NAME_SLURL"] = LLSLURL::buildCommand("group", info->mFromID, "about");
+ }
+ else
+ {
+ args["NAME_SLURL"] = LLSLURL::buildCommand("agent", info->mFromID, "about");
+ }
std::string verb = "select?name=" + LLURI::escape(msg);
args["ITEM_SLURL"] = LLSLURL::buildCommand("inventory", info->mObjectID, verb.c_str());
@@ -1552,7 +1531,7 @@ void inventory_offer_handler(LLOfferInfo* info)
args["ITEM_SLURL"] = msg;
// Note: sets inventory_task_offer_callback as the callback
p.substitutions(args).payload(payload).functor.function(boost::bind(&LLOfferInfo::inventory_task_offer_callback, info, _1, _2));
- p.name = name_found ? "ObjectGiveItem" : "ObjectGiveItemUnknownUser";
+ p.name = "ObjectGiveItem";
// Pop up inv offer chiclet and let the user accept (keep), or reject (and silently delete) the inventory.
LLNotifications::instance().add(p);
}
@@ -1647,6 +1626,60 @@ bool inspect_remote_object_callback(const LLSD& notification, const LLSD& respon
}
static LLNotificationFunctorRegistration inspect_remote_object_callback_reg("ServerObjectMessage", inspect_remote_object_callback);
+// Strip out "Resident" for display, but only if the message came from a user
+// (rather than a script)
+static std::string clean_name_from_im(const std::string& name, EInstantMessage type)
+{
+ U32 pos = 0;
+ switch(type)
+ {
+ case IM_NOTHING_SPECIAL:
+ case IM_MESSAGEBOX:
+ case IM_GROUP_INVITATION:
+ case IM_INVENTORY_OFFERED:
+ case IM_INVENTORY_ACCEPTED:
+ case IM_INVENTORY_DECLINED:
+ case IM_GROUP_VOTE:
+ case IM_GROUP_MESSAGE_DEPRECATED:
+ //IM_TASK_INVENTORY_OFFERED
+ //IM_TASK_INVENTORY_ACCEPTED
+ //IM_TASK_INVENTORY_DECLINED
+ case IM_NEW_USER_DEFAULT:
+ case IM_SESSION_INVITE:
+ case IM_SESSION_P2P_INVITE:
+ case IM_SESSION_GROUP_START:
+ case IM_SESSION_CONFERENCE_START:
+ case IM_SESSION_SEND:
+ case IM_SESSION_LEAVE:
+ //IM_FROM_TASK
+ case IM_BUSY_AUTO_RESPONSE:
+ case IM_CONSOLE_AND_CHAT_HISTORY:
+ case IM_LURE_USER:
+ case IM_LURE_ACCEPTED:
+ case IM_LURE_DECLINED:
+ case IM_GODLIKE_LURE_USER:
+ case IM_YET_TO_BE_USED:
+ case IM_GROUP_ELECTION_DEPRECATED:
+ //IM_GOTO_URL
+ //IM_FROM_TASK_AS_ALERT
+ case IM_GROUP_NOTICE:
+ case IM_GROUP_NOTICE_INVENTORY_ACCEPTED:
+ case IM_GROUP_NOTICE_INVENTORY_DECLINED:
+ case IM_GROUP_INVITATION_ACCEPT:
+ case IM_GROUP_INVITATION_DECLINE:
+ case IM_GROUP_NOTICE_REQUESTED:
+ case IM_FRIENDSHIP_OFFERED:
+ case IM_FRIENDSHIP_ACCEPTED:
+ case IM_FRIENDSHIP_DECLINED_DEPRECATED:
+ //IM_TYPING_START
+ //IM_TYPING_STOP
+ pos = name.find(" Resident");
+ return name.substr(0, pos);
+ default:
+ return name;
+ }
+}
+
void process_improved_im(LLMessageSystem *msg, void **user_data)
{
if (gNoRender)
@@ -1694,6 +1727,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
{
name = LLTrans::getString("Unnamed");
}
+ // IDEVO convert new-style "Resident" names for display
+ name = clean_name_from_im(name, dialog);
BOOL is_busy = gAgent.getBusy();
BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat);
@@ -2478,9 +2513,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());
}
}
@@ -2513,6 +2547,15 @@ void process_decline_callingcard(LLMessageSystem* msg, void**)
LLNotificationsUtil::add("CallingCardDeclined");
}
+static std::string clean_name_from_chat(const std::string& full_name, EChatSourceType type)
+{
+ if (type == CHAT_SOURCE_AGENT)
+ {
+ U32 pos = full_name.find(" Resident");
+ return full_name.substr(0, pos);
+ }
+ return full_name;
+}
void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
{
@@ -2529,7 +2572,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
LLViewerObject* chatter;
msg->getString("ChatData", "FromName", from_name);
- chat.mFromName = from_name;
+ //chat.mFromName = from_name;
msg->getUUID("ChatData", "SourceID", from_id);
chat.mFromID = from_id;
@@ -2548,6 +2591,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
chat.mTime = LLFrameTimer::getElapsedSeconds();
+ // IDEVO Correct for new-style "Resident" names
+ chat.mFromName = clean_name_from_chat(from_name, chat.mSourceType);
+
BOOL is_busy = gAgent.getBusy();
BOOL is_muted = FALSE;
@@ -4716,7 +4762,7 @@ void handle_show_mean_events(void *)
//LLFloaterBump::showInstance();
}
-void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false)
+void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_group)
{
if (gNoRender)
{
@@ -4738,8 +4784,7 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s
LLMeanCollisionData *mcd = *iter;
if (mcd->mPerp == id)
{
- mcd->mFirstName = first;
- mcd->mLastName = last;
+ mcd->mFullName = full_name;
}
}
}
@@ -4793,8 +4838,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use
{
LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag);
gMeanCollisionList.push_front(mcd);
- const BOOL is_group = FALSE;
- gCacheName->get(perp, is_group, &mean_name_callback);
+ gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3));
}
}
}
@@ -5016,7 +5060,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();
@@ -5659,8 +5703,7 @@ void process_script_dialog(LLMessageSystem* msg, void**)
LLNotificationPtr notification;
if (!first_name.empty())
{
- args["FIRST"] = first_name;
- args["LAST"] = 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()));
}
@@ -5693,7 +5736,7 @@ static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", ca
// We've got the name of the person who owns the object hurling the url.
// Display confirmation dialog.
-void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group)
+void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool is_group)
{
std::vector<LLSD>::iterator it;
for (it = gLoadUrlList.begin(); it != gLoadUrlList.end(); )
@@ -5706,11 +5749,11 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st
std::string owner_name;
if (is_group)
{
- owner_name = first + LLTrans::getString("Group");
+ owner_name = full_name + LLTrans::getString("Group");
}
else
{
- owner_name = first + " " + last;
+ owner_name = full_name;
}
// For legacy name-only mutes.
@@ -5770,7 +5813,8 @@ void process_load_url(LLMessageSystem* msg, void**)
// Add to list of pending name lookups
gLoadUrlList.push_back(payload);
- gCacheName->get(owner_id, owner_is_group, &callback_load_url_name);
+ gCacheName->get(owner_id, owner_is_group,
+ boost::bind(&callback_load_url_name, _1, _2, _3));
}
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 07c8867e26..ba1e7ed89b 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -2074,10 +2074,9 @@ void LLViewerParcelMgr::deedLandToGroup()
args["GROUP_NAME"] = group_name;
if(mCurrentParcel->getContributeWithDeed())
{
- std::string first_name, last_name;
- gCacheName->getName(mCurrentParcel->getOwnerID(), first_name, last_name);
- args["FIRST_NAME"] = first_name;
- args["LAST_NAME"] = last_name;
+ std::string full_name;
+ gCacheName->getFullName(mCurrentParcel->getOwnerID(), full_name);
+ args["NAME"] = full_name;
LLNotificationsUtil::add("DeedLandToGroupWithContribution",args, LLSD(), deedAlertCB);
}
else
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b76a2e150f..c09f8e46b0 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1186,12 +1186,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));
@@ -1726,7 +1722,7 @@ void LLViewerWindow::shutdownViews()
// destroy the nav bar, not currently part of gViewerWindow
// *TODO: Make LLNavigationBar part of gViewerWindow
delete LLNavigationBar::getInstance();
-
+
// destroy menus after instantiating navbar above, as it needs
// access to gMenuHolder
cleanup_menus();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 698b6be98b..265adb3e7f 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"
@@ -52,6 +53,7 @@
#include "llanimationstates.h"
#include "llavatarpropertiesprocessor.h"
#include "llviewercontrol.h"
+#include "llcallingcard.h" // IDEVO for LLAvatarTracker
#include "lldrawpoolavatar.h"
#include "lldriverparam.h"
#include "lleditingmotion.h"
@@ -650,11 +652,13 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mAppearanceAnimating(FALSE),
mNameString(),
mTitle(),
- mNameAway(FALSE),
- mNameBusy(FALSE),
- mNameMute(FALSE),
+ mNameAway(false),
+ mNameBusy(false),
+ mNameMute(false),
+ mNameAppearance(false),
+ mNameFriend(false),
+ mNameAlpha(0.f),
mRenderGroupTitles(sRenderGroupTitles),
- mNameAppearance(FALSE),
mFirstTEMessageReceived( FALSE ),
mFirstAppearanceMessageReceived( FALSE ),
mCulled( FALSE ),
@@ -2665,288 +2669,335 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
&& gSavedSettings.getS32("AvatarNameTagMode") ));
}
- if ( render_name )
+ if ( !render_name )
{
- BOOL new_name = FALSE;
- if (visible_chat != mVisibleChat)
+ if (mNameText)
{
- mVisibleChat = visible_chat;
- new_name = TRUE;
+ // ...clean up old name tag
+ mNameText->markDead();
+ mNameText = NULL;
+ sNumVisibleChatBubbles--;
}
-
- if (sRenderGroupTitles != mRenderGroupTitles)
+ return;
+ }
+
+ BOOL new_name = FALSE;
+ if (visible_chat != mVisibleChat)
+ {
+ mVisibleChat = visible_chat;
+ new_name = TRUE;
+ }
+
+ if (sRenderGroupTitles != mRenderGroupTitles)
+ {
+ mRenderGroupTitles = sRenderGroupTitles;
+ new_name = TRUE;
+ }
+
+ // First Calculate Alpha
+ // If alpha > 0, create mNameText if necessary, otherwise delete it
+ F32 alpha = 0.f;
+ if (mAppAngle > 5.f)
+ {
+ const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION;
+ if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME)
+ {
+ alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION;
+ }
+ else
+ {
+ // ...not fading, full alpha
+ alpha = 1.f;
+ }
+ }
+ else if (mAppAngle > 2.f)
+ {
+ // far away is faded out also
+ alpha = (mAppAngle-2.f)/3.f;
+ }
+
+ if (alpha <= 0.f)
+ {
+ if (mNameText)
+ {
+ mNameText->markDead();
+ mNameText = NULL;
+ sNumVisibleChatBubbles--;
+ }
+ return;
+ }
+
+ if (!mNameText)
+ {
+ mNameText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
+ mNameText->setMass(10.f);
+ mNameText->setSourceObject(this);
+ mNameText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP);
+ mNameText->setVisibleOffScreen(TRUE);
+ mNameText->setMaxLines(11);
+ mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
+ mNameText->setUseBubble(TRUE);
+ sNumVisibleChatBubbles++;
+ new_name = TRUE;
+ }
+
+ idleUpdateNameTagColor(new_name, alpha);
+
+ LLVector3 name_position = idleUpdateNameTagPosition(root_pos_last);
+ mNameText->setPositionAgent(name_position);
+
+ LLNameValue *title = getNVPair("Title");
+ LLNameValue* firstname = getNVPair("FirstName");
+ LLNameValue* lastname = getNVPair("LastName");
+
+ // Avatars must have a first and last name
+ if (!firstname || !lastname) return;
+
+ bool is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end();
+ bool is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end();
+ bool is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end();
+ bool is_muted;
+ if (isSelf())
+ {
+ is_muted = false;
+ }
+ else
+ {
+ is_muted = LLMuteList::getInstance()->isMuted(getID());
+ }
+
+ // Rebuild name tag if state change detected
+ if (mNameString.empty()
+ || new_name
+ || (!title && !mTitle.empty())
+ || (title && mTitle != title->getString())
+ || is_away != mNameAway
+ || is_busy != mNameBusy
+ || is_muted != mNameMute
+ || is_appearance != mNameAppearance)
+ {
+ std::string line;
+ // 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 (sRenderGroupTitles
+ && title && title->getString() && title->getString()[0] != '\0')
{
- mRenderGroupTitles = sRenderGroupTitles;
- new_name = TRUE;
+ line += title->getString();
+ LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR);
+ line += "\n";
}
- // First Calculate Alpha
- // If alpha > 0, create mNameText if necessary, otherwise delete it
+ std::string display_name;
+ if (gCacheName->getDisplayName(getID(), display_name))
{
- F32 alpha = 0.f;
- if (mAppAngle > 5.f)
+ line += display_name;
+ }
+ else
+ {
+ line += LLCacheName::buildFullName( firstname->getString(), lastname->getString() );
+ }
+
+ BOOL need_comma = FALSE;
+
+ if (is_away || is_muted || is_busy)
+ {
+ line += " (";
+ if (is_away)
+ {
+ line += LLTrans::getString("AvatarAway");
+ need_comma = TRUE;
+ }
+ if (is_busy)
{
- const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION;
- if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME)
+ if (need_comma)
{
- alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION;
+ line += ", ";
}
- else
+ line += LLTrans::getString("AvatarBusy");
+ need_comma = TRUE;
+ }
+ if (is_muted)
+ {
+ if (need_comma)
{
- // ...not fading, full alpha
- alpha = 1.f;
+ line += ", ";
}
+ line += LLTrans::getString("AvatarMuted");
+ need_comma = TRUE;
}
- else if (mAppAngle > 2.f)
+ line += ")";
+ }
+ if (is_appearance)
+ {
+ line += "\n";
+ line += LLTrans::getString("AvatarEditingAppearance");
+ }
+ mNameAway = is_away;
+ mNameBusy = is_busy;
+ mNameMute = is_muted;
+ mNameAppearance = is_appearance;
+ mTitle = title ? title->getString() : "";
+ LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR);
+ mNameString = utf8str_to_wstring(line);
+ new_name = TRUE;
+ }
+
+ if (visible_chat)
+ {
+ mNameText->setDropShadow(TRUE);
+ mNameText->setFont(LLFontGL::getFontSansSerif());
+ mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT);
+ mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f);
+ if (new_name)
+ {
+ mNameText->setLabel(mNameString);
+ }
+
+ char line[MAX_STRING]; /* Flawfinder: ignore */
+ line[0] = '\0';
+ std::deque<LLChat>::iterator chat_iter = mChats.begin();
+ mNameText->clearString();
+
+ LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" );
+ LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
+ LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
+ if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
+ {
+ ++chat_iter;
+ }
+
+ for(; chat_iter != mChats.end(); ++chat_iter)
+ {
+ F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f);
+ LLFontGL::StyleFlags style;
+ switch(chat_iter->mChatType)
{
- // far away is faded out also
- alpha = (mAppAngle-2.f)/3.f;
+ case CHAT_TYPE_WHISPER:
+ style = LLFontGL::ITALIC;
+ break;
+ case CHAT_TYPE_SHOUT:
+ style = LLFontGL::BOLD;
+ break;
+ default:
+ style = LLFontGL::NORMAL;
+ break;
}
-
- if (alpha > 0.f)
+ if (chat_fade_amt < 1.f)
{
- if (!mNameText)
- {
- mNameText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
- mNameText->setMass(10.f);
- mNameText->setSourceObject(this);
- mNameText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP);
- mNameText->setVisibleOffScreen(TRUE);
- mNameText->setMaxLines(11);
- mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
- mNameText->setUseBubble(TRUE);
- sNumVisibleChatBubbles++;
- new_name = TRUE;
- }
-
- LLColor4 avatar_name_color = LLUIColorTable::instance().getColor( "AvatarNameColor" );
- avatar_name_color.setAlpha(alpha);
- mNameText->setColor(avatar_name_color);
-
- LLQuaternion root_rot = mRoot.getWorldRotation();
- mNameText->setUsePixelSize(TRUE);
- LLVector3 pixel_right_vec;
- LLVector3 pixel_up_vec;
- LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec);
- LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin();
- camera_to_av.normalize();
- LLVector3 local_camera_at = camera_to_av * ~root_rot;
- LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis();
- local_camera_up.normalize();
- local_camera_up = local_camera_up * ~root_rot;
-
- local_camera_up.scaleVec(mBodySize * 0.5f);
- local_camera_at.scaleVec(mBodySize * 0.5f);
-
- LLVector3 name_position = mRoot.getWorldPosition() +
- (local_camera_up * root_rot) -
- (projected_vec(local_camera_at * root_rot, camera_to_av));
- name_position += pixel_up_vec * 15.f;
- mNameText->setPositionAgent(name_position);
+ F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f);
+ mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(new_chat, normal_chat, u), style);
+ }
+ else if (chat_fade_amt < 2.f)
+ {
+ F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f);
+ mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(normal_chat, old_chat, u), style);
}
- else if (mNameText)
+ else if (chat_fade_amt < 3.f)
{
- mNameText->markDead();
- mNameText = NULL;
- sNumVisibleChatBubbles--;
+ // *NOTE: only remove lines down to minimum number
+ mNameText->addLine(utf8str_to_wstring(chat_iter->mText), old_chat, style);
}
}
-
- LLNameValue *title = getNVPair("Title");
- LLNameValue* firstname = getNVPair("FirstName");
- LLNameValue* lastname = getNVPair("LastName");
+ mNameText->setVisibleOffScreen(TRUE);
- if (mNameText.notNull() && firstname && lastname)
+ if (mTyping)
{
- BOOL is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end();
- BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end();
- BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end();
- BOOL is_muted;
- if (isSelf())
+ S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1;
+ switch(dot_count)
{
- is_muted = FALSE;
- }
- else
- {
- is_muted = LLMuteList::getInstance()->isMuted(getID());
+ case 1:
+ mNameText->addLine(".", new_chat);
+ break;
+ case 2:
+ mNameText->addLine("..", new_chat);
+ break;
+ case 3:
+ mNameText->addLine("...", new_chat);
+ break;
}
- if (mNameString.empty() ||
- new_name ||
- (!title && !mTitle.empty()) ||
- (title && mTitle != title->getString()) ||
- (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute)
- || 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')
- {
- line += title->getString();
- LLStringFn::replace_ascii_controlchars(line,LL_UNKNOWN_CHAR);
- line += "\n";
- line += firstname->getString();
- }
- else
- {
- line += firstname->getString();
- }
+ }
+ }
+ else
+ {
+ static LLUICachedControl<bool> small_avatar_names("SmallAvatarNames");
+ if (small_avatar_names)
+ {
+ mNameText->setFont(LLFontGL::getFontSansSerif());
+ }
+ else
+ {
+ mNameText->setFont(LLFontGL::getFontSansSerifBig());
+ }
+ mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER);
+ mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
+ mNameText->setVisibleOffScreen(FALSE);
+ if (new_name)
+ {
+ mNameText->setLabel("");
+ mNameText->setString(mNameString);
+ }
+ }
+}
- line += " ";
- line += lastname->getString();
- BOOL need_comma = FALSE;
+// Compute name tag position during idle update
+LLVector3 LLVOAvatar::idleUpdateNameTagPosition(const LLVector3& root_pos_last)
+{
+ LLQuaternion root_rot = mRoot.getWorldRotation();
+ LLVector3 pixel_right_vec;
+ LLVector3 pixel_up_vec;
+ LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec);
+ LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin();
+ camera_to_av.normalize();
+ LLVector3 local_camera_at = camera_to_av * ~root_rot;
+ LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis();
+ local_camera_up.normalize();
+ local_camera_up = local_camera_up * ~root_rot;
- if (is_away || is_muted || is_busy)
- {
- line += " (";
- if (is_away)
- {
- line += LLTrans::getString("AvatarAway");
- need_comma = TRUE;
- }
- if (is_busy)
- {
- if (need_comma)
- {
- line += ", ";
- }
- line += LLTrans::getString("AvatarBusy");
- need_comma = TRUE;
- }
- if (is_muted)
- {
- if (need_comma)
- {
- line += ", ";
- }
- line += LLTrans::getString("AvatarMuted");
- need_comma = TRUE;
- }
- line += ")";
- }
- if (is_appearance)
- {
- line += "\n";
- line += LLTrans::getString("AvatarEditingAppearance");
- }
- mNameAway = is_away;
- mNameBusy = is_busy;
- mNameMute = is_muted;
- mNameAppearance = is_appearance;
- mTitle = title ? title->getString() : "";
- LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR);
- mNameString = utf8str_to_wstring(line);
- new_name = TRUE;
- }
-
- if (visible_chat)
- {
- mNameText->setDropShadow(TRUE);
- mNameText->setFont(LLFontGL::getFontSansSerif());
- mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_LEFT);
- mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f);
- if (new_name)
- {
- mNameText->setLabel(mNameString);
- }
-
- char line[MAX_STRING]; /* Flawfinder: ignore */
- line[0] = '\0';
- std::deque<LLChat>::iterator chat_iter = mChats.begin();
- mNameText->clearString();
-
- LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" );
- LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
- LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
- if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
- {
- ++chat_iter;
- }
+ local_camera_up.scaleVec(mBodySize * 0.5f);
+ local_camera_at.scaleVec(mBodySize * 0.5f);
- for(; chat_iter != mChats.end(); ++chat_iter)
- {
- F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f);
- LLFontGL::StyleFlags style;
- switch(chat_iter->mChatType)
- {
- case CHAT_TYPE_WHISPER:
- style = LLFontGL::ITALIC;
- break;
- case CHAT_TYPE_SHOUT:
- style = LLFontGL::BOLD;
- break;
- default:
- style = LLFontGL::NORMAL;
- break;
- }
- if (chat_fade_amt < 1.f)
- {
- F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f);
- mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(new_chat, normal_chat, u), style);
- }
- else if (chat_fade_amt < 2.f)
- {
- F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f);
- mNameText->addLine(utf8str_to_wstring(chat_iter->mText), lerp(normal_chat, old_chat, u), style);
- }
- else if (chat_fade_amt < 3.f)
- {
- // *NOTE: only remove lines down to minimum number
- mNameText->addLine(utf8str_to_wstring(chat_iter->mText), old_chat, style);
- }
- }
- mNameText->setVisibleOffScreen(TRUE);
+ LLVector3 name_position = mRoot.getWorldPosition() +
+ (local_camera_up * root_rot) -
+ (projected_vec(local_camera_at * root_rot, camera_to_av));
+ name_position += pixel_up_vec * 15.f;
+ return name_position;
+ }
- if (mTyping)
- {
- S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1;
- switch(dot_count)
- {
- case 1:
- mNameText->addLine(".", new_chat);
- break;
- case 2:
- mNameText->addLine("..", new_chat);
- break;
- case 3:
- mNameText->addLine("...", new_chat);
- break;
- }
+void LLVOAvatar::idleUpdateNameTagColor(BOOL new_name, F32 alpha)
+ {
+ llassert(mNameText);
- }
- }
- else
- {
- if (gSavedSettings.getBOOL("SmallAvatarNames"))
- {
- mNameText->setFont(LLFontGL::getFontSansSerif());
- }
- else
- {
- mNameText->setFont(LLFontGL::getFontSansSerifBig());
- }
- mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER);
- mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
- mNameText->setVisibleOffScreen(FALSE);
- if (new_name)
- {
- mNameText->setLabel("");
- mNameText->setString(mNameString);
- }
- }
- }
- }
- else if (mNameText)
+ bool is_friend = LLAvatarTracker::instance().isBuddy(getID());
+ if (new_name
+ || alpha != mNameAlpha
+ || is_friend != mNameFriend)
{
- mNameText->markDead();
- mNameText = NULL;
- sNumVisibleChatBubbles--;
+ const char* color_name = (is_friend ? "AvatarNameFriendColor" : "AvatarNameColor");
+ LLColor4 avatar_name_color =
+ LLUIColorTable::getInstance()->getColor( color_name );
+ avatar_name_color.setAlpha(alpha);
+ mNameText->setColor(avatar_name_color);
+
+ mNameFriend = is_friend;
+ mNameAlpha = alpha;
}
}
@@ -7523,9 +7574,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;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index b5f0ec7176..cf3f40979b 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -210,6 +210,8 @@ public:
void idleUpdateLoadingEffect();
void idleUpdateWindEffect();
void idleUpdateNameTag(const LLVector3& root_pos_last);
+ LLVector3 idleUpdateNameTagPosition(const LLVector3& root_pos_last);
+ void idleUpdateNameTagColor(BOOL new_name, F32 alpha);
void idleUpdateRenderCost();
void idleUpdateTractorBeam();
void idleUpdateBelowWater();
@@ -822,10 +824,12 @@ protected:
private:
LLWString mNameString;
std::string mTitle;
- BOOL mNameAway;
- BOOL mNameBusy;
- BOOL mNameMute;
- BOOL mNameAppearance;
+ bool mNameAway;
+ bool mNameBusy;
+ bool mNameMute;
+ bool mNameAppearance;
+ bool mNameFriend;
+ F32 mNameAlpha;
BOOL mRenderGroupTitles;
//--------------------------------------------------------------------
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index f3bfc2e86c..b57e33fd08 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -7084,18 +7084,8 @@ void LLVoiceClient::notifyFriendObservers()
void LLVoiceClient::lookupName(const LLUUID &id)
{
- BOOL is_group = FALSE;
- gCacheName->get(id, is_group, &LLVoiceClient::onAvatarNameLookup);
-}
-
-//static
-void LLVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group)
-{
- if(gVoiceClient)
- {
- std::string name = llformat("%s %s", first.c_str(), last.c_str());
- gVoiceClient->avatarNameResolved(id, name);
- }
+ gCacheName->get(id, false,
+ boost::bind(&LLVoiceClient::avatarNameResolved, this, _1, _2));
}
void LLVoiceClient::avatarNameResolved(const LLUUID &id, const std::string &name)
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index a96cf18e27..d020d796c0 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -477,7 +477,6 @@ static void updatePosition(void);
void removeObserver(LLFriendObserver* observer);
void lookupName(const LLUUID &id);
- static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
void avatarNameResolved(const LLUUID &id, const std::string &name);
typedef std::vector<std::string> deviceList;
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index b33d4f73a4..93dafcf2c1 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -118,6 +118,9 @@
name="AvatarNameColor"
reference="White" />
<color
+ name="AvatarNameFriendColor"
+ reference="Green" />
+ <color
name="AvatarListItemIconDefaultColor"
reference="White" />
<color
diff --git a/indra/newview/skins/default/xui/en/floater_bumps.xml b/indra/newview/skins/default/xui/en/floater_bumps.xml
index 303c28d7c8..1f2fe62b3c 100644
--- a/indra/newview/skins/default/xui/en/floater_bumps.xml
+++ b/indra/newview/skins/default/xui/en/floater_bumps.xml
@@ -14,23 +14,23 @@
</floater.string>
<floater.string
name="bump">
- [TIME] [FIRST] [LAST] bumped you
+ [TIME] [NAME] bumped you
</floater.string>
<floater.string
name="llpushobject">
- [TIME] [FIRST] [LAST] pushed you with a script
+ [TIME] [NAME] pushed you with a script
</floater.string>
<floater.string
name="selected_object_collide">
- [TIME] [FIRST] [LAST] hit you with an object
+ [TIME] [NAME] hit you with an object
</floater.string>
<floater.string
name="scripted_object_collide">
- [TIME] [FIRST] [LAST] hit you with a scripted object
+ [TIME] [NAME] hit you with a scripted object
</floater.string>
<floater.string
name="physical_object_collide">
- [TIME] [FIRST] [LAST] hit you with a physical object
+ [TIME] [NAME] hit you with a physical object
</floater.string>
<floater.string
name="timeStr">
diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml
index 509cffe490..8f60dd6f28 100644
--- a/indra/newview/skins/default/xui/en/floater_pay.xml
+++ b/indra/newview/skins/default/xui/en/floater_pay.xml
@@ -28,16 +28,6 @@
width="75">
Pay:
</text>
- <icon
- height="16"
- width="16"
- image_name="Generic_Person"
- mouse_opaque="true"
- name="icon_person"
- tool_tip="Person"
- top_pad="0"
- left="10"
- />
<text
type="string"
length="1"
@@ -45,10 +35,11 @@
font="SansSerifSmall"
height="16"
layout="topleft"
- left_pad="7"
+ left="10"
name="payee_name"
- width="210">
- [FIRST] [LAST]
+ top_pad="0"
+ width="230">
+ Test Name
</text>
<button
height="23"
diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml
index d09a0a0535..c65dd6e49f 100644
--- a/indra/newview/skins/default/xui/en/floater_pay_object.xml
+++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml
@@ -2,7 +2,7 @@
<floater
legacy_header_height="18"
can_minimize="false"
- height="220"
+ height="225"
layout="topleft"
name="Give Money"
help_topic="give_money"
@@ -16,27 +16,15 @@
name="payee_resident">
Pay Resident
</string>
- <icon
- height="16"
- width="16"
- image_name="Generic_Person"
- mouse_opaque="true"
- name="icon_person"
- tool_tip="Person"
- top_pad="24"
- left="10"
- />
<text
- type="string"
- length="1"
follows="left|top"
height="16"
layout="topleft"
- left_pad="7"
- top_delta="3"
+ left="10"
+ top_pad="24"
name="payee_name"
- width="184">
- [FIRST] [LAST]
+ width="200">
+ Ericacita Moostopolison
</text>
<text
type="string"
@@ -45,9 +33,9 @@
halign="left"
height="14"
layout="topleft"
- left="34"
+ left="10"
name="object_name_label"
- top_pad="0"
+ top_pad="5"
width="180">
Via object:
</text>
@@ -58,7 +46,7 @@
mouse_opaque="true"
name="icon_object"
tool_tip="Objects"
- top_pad="0"
+ top_pad="5"
left="10"
/>
<text
diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml
index 9796f7b5b6..b7717859fc 100644
--- a/indra/newview/skins/default/xui/en/inspect_avatar.xml
+++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml
@@ -9,7 +9,7 @@
bg_opaque_image="Inspector_Background"
can_close="false"
can_minimize="false"
- height="148"
+ height="164"
layout="topleft"
name="inspect_avatar"
single_instance="true"
@@ -47,9 +47,20 @@
follows="top|left"
height="16"
left="8"
+ name="user_slid"
+ font="SansSerifSmall"
+ text_color="White"
+ value="James.pinden"
+ width="175"
+ use_ellipses="true" />
+ <text
+ follows="top|left"
+ height="16"
+ left="8"
name="user_subtitle"
font="SansSerifSmall"
text_color="White"
+ top_pad="0"
value="11 Months, 3 days old"
width="175"
use_ellipses="true" />
@@ -108,7 +119,7 @@
height="20"
label="Add Friend"
left="8"
- top="119"
+ top="135"
name="add_friend_btn"
width="90" />
<button
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 51f0f6839c..665a49b6d8 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -257,7 +257,7 @@ Save all changes to clothing/body parts?
name="GrantModifyRights"
type="alertmodal">
Granting modify rights to another Resident allows them to change, delete or take ANY objects you may have in-world. Be VERY careful when handing out this permission.
-Do you want to grant modify rights for [FIRST_NAME] [LAST_NAME]?
+Do you want to grant modify rights for [NAME]?
<usetemplate
name="okcancelbuttons"
notext="No"
@@ -280,7 +280,7 @@ Do you want to grant modify rights for the selected Residents?
icon="alertmodal.tga"
name="RevokeModifyRights"
type="alertmodal">
-Do you want to revoke modify rights for [FIRST_NAME] [LAST_NAME]?
+Do you want to revoke modify rights for [NAME]?
<usetemplate
name="okcancelbuttons"
notext="No"
@@ -392,9 +392,9 @@ Add this Ability to &apos;[ROLE_NAME]&apos;?
yestext="Yes"/>
</notification>
<notification
- icon="alertmodal.tga"
+ icon="alertmodal.tga"
name="JoinGroupCanAfford"
- type="alertmodal">
+ type="alertmodal">
Joining this group costs L$[COST].
Do you wish to proceed?
<usetemplate
@@ -614,7 +614,7 @@ To place the media on only one face, choose Select Face and click on the desired
notext="Cancel"
yestext="OK"/>
</notification>
-
+
<notification
icon="alertmodal.tga"
name="MustBeInParcel"
@@ -785,7 +785,7 @@ Save changes to classified [NAME]?
notext="Don&apos;t Save"
yestext="Save"/>
</notification>
-
+
<notification
icon="alertmodal.tga"
name="ClassifiedInsufficientFunds"
@@ -836,7 +836,7 @@ Please select a proposal to view.
Please select a history item to view.
</notification>
-<!--
+<!--
<notification
icon="alertmodal.tga"
name="ResetShowNextTimeDialogs"
@@ -2028,7 +2028,7 @@ Would you be my friend?
icon="alertmodal.tga"
name="RemoveFromFriends"
type="alertmodal">
-Do you want to remove [FIRST_NAME] [LAST_NAME] from your Friends List?
+Do you want to remove [NAME] from your Friends List?
<usetemplate
name="okcancelbuttons"
notext="Cancel"
@@ -2268,7 +2268,7 @@ Deed this [AREA] m² of land to the group &apos;[GROUP_NAME]&apos;?
name="DeedLandToGroupWithContribution"
type="alertmodal">
By deeding this parcel, the group will be required to have and maintain sufficient land use credits.
-The deed will include a simultaneous land contribution to the group from &apos;[FIRST_NAME] [LAST_NAME]&apos;.
+The deed will include a simultaneous land contribution to the group from &apos;[NAME]&apos;.
The purchase price of the land is not refunded to the owner. If a deeded parcel is sold, the sale price will be divided evenly among group members.
Deed this [AREA] m² of land to the group &apos;[GROUP_NAME]&apos;?
@@ -4469,13 +4469,6 @@ You cannot remove protected categories.
<notification
icon="notifytip.tga"
- name="OfferedCard"
- type="notifytip">
-You have offered a calling card to [FIRST] [LAST]
- </notification>
-
- <notification
- icon="notifytip.tga"
name="UnableToBuyWhileDownloading"
type="notifytip">
Unable to buy while downloading object data.
@@ -4632,7 +4625,7 @@ Please select at least one type of content to search (General, Moderate, or Adul
type="notify">
[MESSAGE]
</notification>
-
+
<notification
icon="notify.tga"
name="EventNotification"
@@ -4717,7 +4710,7 @@ The objects you own on the selected parcel of land have been returned back to yo
icon="notify.tga"
name="OtherObjectsReturned"
type="notify">
-The objects on the selected parcel of land that is owned by [FIRST] [LAST] have been returned to his or her inventory.
+The objects on the selected parcel of land that is owned by [NAME] have been returned to his or her inventory.
</notification>
<notification
@@ -5025,28 +5018,6 @@ An object named [OBJECTFROMNAME] owned by [NAME_SLURL] has given you this [OBJEC
<notification
icon="notify.tga"
- name="ObjectGiveItemUnknownUser"
- type="offer">
-An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you this [OBJECTTYPE]:
-[ITEM_SLURL]
- <form name="form">
- <button
- index="0"
- name="Keep"
- text="Keep"/>
- <button
- index="1"
- name="Discard"
- text="Discard"/>
- <button
- index="2"
- name="Mute"
- text="Block"/>
- </form>
- </notification>
-
- <notification
- icon="notify.tga"
name="UserGiveItem"
type="offer">
[NAME_SLURL] has given you this [OBJECTTYPE]:
@@ -5162,7 +5133,7 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you th
text="Decline"/>
</form>
</notification>
-
+
<notification
icon="notify.tga"
name="FriendshipOffered"
@@ -5339,7 +5310,7 @@ Grant this request?
icon="notify.tga"
name="ScriptDialog"
type="notify">
-[FIRST] [LAST]&apos;s &apos;[TITLE]&apos;
+[NAME]&apos;s &apos;[TITLE]&apos;
[MESSAGE]
<form name="form">
<button
@@ -5412,8 +5383,8 @@ Your L$ balance will be updated when processing completes. If processing takes m
The status of your payment can be checked on your Transaction History page on your [http://secondlife.com/account/ Dashboard]
</notification>
-
-<!--
+
+<!--
<notification
icon="notify.tga"
name="FirstSit"
@@ -5440,7 +5411,7 @@ You have opened the Build Tools. Every object you see around you was created usi
</notification>
-->
-<!--
+<!--
<notification
icon="notify.tga"
name="FirstLeftClickNoHit"
@@ -5526,7 +5497,7 @@ To toggle this menu,
type="notify">
You are editing a Sculpted prim. Sculpties require a special texture to define their shape.
</notification>
--->
+-->
<!--
<notification
@@ -5573,21 +5544,21 @@ Click Accept to join the call or Decline to decline the invitation. Click Block
icon="notify.tga"
name="AutoUnmuteByIM"
type="notify">
-[FIRST] [LAST] was sent an instant message and has been automatically unblocked.
+[NAME] was sent an instant message and has been automatically unblocked.
</notification>
<notification
icon="notify.tga"
name="AutoUnmuteByMoney"
type="notify">
-[FIRST] [LAST] was given money and has been automatically unblocked.
+[NAME] was given money and has been automatically unblocked.
</notification>
<notification
icon="notify.tga"
name="AutoUnmuteByInventory"
type="notify">
-[FIRST] [LAST] was offered inventory and has been automatically unblocked.
+[NAME] was offered inventory and has been automatically unblocked.
</notification>
<notification
@@ -5815,7 +5786,7 @@ A SLurl was received from an untrusted browser and has been blocked for your sec
priority="high"
type="notifytip">
Multiple SLurls were received from an untrusted browser within a short period.
-They will be blocked for a few seconds for your security.
+They will be blocked for a few seconds for your security.
</notification>
<notification name="IMToast" type="notifytoast">
diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml
index 627e616af5..20f91d85ab 100644
--- a/indra/newview/skins/default/xui/en/panel_login.xml
+++ b/indra/newview/skins/default/xui/en/panel_login.xml
@@ -60,7 +60,7 @@ name="first_name_text"
top="20"
left="20"
width="150">
-First name:
+ Second Life Name or ID:
</text>
<line_editor
follows="left|bottom"
@@ -69,20 +69,23 @@ height="22"
label="First"
left_delta="0"
max_length="31"
-name="first_name_edit"
+name="login_id_edit"
+prevalidate_callback="ascii"
select_on_focus="true"
-tool_tip="[SECOND_LIFE] First Name"
+tool_tip="[SECOND_LIFE] ID"
top_pad="0"
- width="135" />
+ width="200" />
<text
follows="left|bottom"
font="SansSerifSmall"
height="16"
- left_pad="8"
+ left="230"
name="last_name_text"
top="20"
+ visible="false"
width="150">
- Last name: </text>
+ Last name:
+ </text>
<line_editor
follows="left|bottom"
handle_edit_keys_directly="true"
@@ -93,12 +96,13 @@ name="last_name_edit"
select_on_focus="true"
tool_tip="[SECOND_LIFE] Last Name"
top_pad="0"
+ visible="false"
width="135" />
<text
follows="left|bottom"
font="SansSerifSmall"
height="15"
-left_pad="8"
+left="230"
name="password_text"
top="20"
width="150">
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 39762d57fb..ae986f1851 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2930,7 +2930,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
You are the only user in this session.
</string>
<string name="offline_message">
- [FIRST] [LAST] is offline.
+ [NAME] is offline.
</string>
<string name="invite_message">
Click the [BUTTON NAME] button to accept/connect to this voice chat.