summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llavatarpropertiesprocessor.cpp3
-rw-r--r--indra/newview/llgroupcolormap.cpp5
-rw-r--r--indra/newview/llgroupcolormap.h2
-rw-r--r--indra/newview/llvoavatar.cpp4
4 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index aa24c69831..cc3f1128ed 100644
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -34,6 +34,7 @@
#include "lldateutil.h"
#include "llviewergenericmessage.h"
#include "llstartup.h"
+#include "llgroupcolormap.h"
// Linden library includes
#include "llavataractions.h" // for getProfileUrl
@@ -534,6 +535,8 @@ void LLAvatarPropertiesProcessor::processAvatarGroupsReply(LLMessageSystem* msg,
LL_DEBUGS("AvatarProperties") << "Received AvatarGroupsReply for "
<< avatar_groups.avatar_id << LL_ENDL;
+ if (!LLGroupColorMap::getInstance()->hasAnyGroupColor()) return;
+
S32 group_count = msg->getNumberOfBlocksFast(_PREHASH_GroupData);
for (S32 i = 0; i < group_count; ++i)
{
diff --git a/indra/newview/llgroupcolormap.cpp b/indra/newview/llgroupcolormap.cpp
index 36fde1ce38..23690d304b 100644
--- a/indra/newview/llgroupcolormap.cpp
+++ b/indra/newview/llgroupcolormap.cpp
@@ -56,6 +56,11 @@ LLColor4 LLGroupColorMap::getGroupColor(const LLUUID& group_id) const
return LLColor4::transparent;
}
+bool LLGroupColorMap::hasAnyGroupColor() const
+{
+ return !mColors.empty();
+}
+
bool LLGroupColorMap::hasGroupColor(const LLUUID& group_id) const
{
if (group_id.isNull())
diff --git a/indra/newview/llgroupcolormap.h b/indra/newview/llgroupcolormap.h
index d6f661c43a..a4cf9d17e0 100644
--- a/indra/newview/llgroupcolormap.h
+++ b/indra/newview/llgroupcolormap.h
@@ -40,6 +40,8 @@ public:
/** Return the tint for @p group_id, or LLColor4::transparent if none. */
LLColor4 getGroupColor(const LLUUID& group_id) const;
+ bool hasAnyGroupColor() const;
+
/** True if a non-transparent color is stored for this group. */
bool hasGroupColor(const LLUUID& group_id) const;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 9b8e42ef09..dc498d4b69 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3663,7 +3663,7 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name)
// and we can discover the active group UUID. We register ourselves as an
// observer for APT_GROUPS in processProperties() below.
const std::string new_title = title ? title->getString() : "";
- if (!isSelf() && new_title != mTitle)
+ if (LLGroupColorMap::getInstance()->hasAnyGroupColor() && !isSelf() && new_title != mTitle)
{
// Reset cached group UUID - it will be repopulated by the reply.
mActiveGroupID.setNull();
@@ -3911,6 +3911,8 @@ LLColor4 LLVOAvatar::getNameTagColor(bool is_friend)
LLColor4 base_color = LLUIColorTable::getInstance()->getColor(color_name);
+ if (!LLGroupColorMap::getInstance()->hasAnyGroupColor()) return base_color;
+
// Group-based nameplate tinting: override with the group color if one is set.
// For self, the active group UUID is always available via gAgent.
// For others, it is populated asynchronously via AvatarGroupsReply.