summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-04-26 10:51:42 -0700
committerJames Cook <james@lindenlab.com>2010-04-26 10:51:42 -0700
commitd89de271437f35f9d26e28409e6cc1d593a2fc7a (patch)
tree8cea7005d835a2706939657aef8a552c342b1449 /indra/newview/llappviewer.cpp
parentc1ff7147974a031643776d8ea950f1bc1466737c (diff)
DEV-47529 Viewer turns display names on/off based on region capability
Also refreshes name tags so you can see the state. Reviewed with Kelly.
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index e160951b91..3b236676f1 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3919,7 +3919,8 @@ void LLAppViewer::idleNameCache()
std::string name_lookup_url;
name_lookup_url.reserve(128); // avoid a memory allocation below
name_lookup_url = region->getCapability("GetDisplayNames");
- if (!name_lookup_url.empty())
+ bool have_capability = !name_lookup_url.empty();
+ if (have_capability)
{
// we have support for display names, use it
U32 url_size = name_lookup_url.size();
@@ -3939,6 +3940,21 @@ void LLAppViewer::idleNameCache()
LLAvatarNameCache::setNameLookupURL( std::string() );
}
+ // Error recovery - did we change state?
+ if (LLAvatarNameCache::useDisplayNames() && !have_capability)
+ {
+ // ...we just lost the capability, turn names off
+ LLAvatarNameCache::setUseDisplayNames(false);
+ // name tags are persistant on screen, so make sure they refresh
+ LLVOAvatar::invalidateNameTags();
+ }
+ else if (!LLAvatarNameCache::useDisplayNames() && have_capability)
+ {
+ // ...we just gained the capability, turn names on
+ LLAvatarNameCache::setUseDisplayNames(true);
+ LLVOAvatar::invalidateNameTags();
+ }
+
LLAvatarNameCache::idle();
}