diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index dbcdd579b69538d7402be247fca679f6d94031ff..940c05d9c19656d83825a8b6e0f0b81ad5515dd7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1,4 +1,4 @@ -/** +/** * @File llvoavatar.cpp * @brief Implementation of LLVOAvatar class which is a derivation of LLViewerObject * @@ -676,6 +676,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastUpdateReceivedCOFVersion(-1), mCachedMuteListUpdateTime(0), mCachedInMuteList(false), + mCachedBuddyListUpdateTime(0), + mCachedInBuddyList(false), mIsControlAvatar(false), mIsUIAvatar(false), mEnableDefaultMotions(true) @@ -3169,7 +3171,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } // bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); // [RLVa:KB] - Checked: RLVa-1.2.2 - bool is_friend = (fRlvShowAvName) && (LLAvatarTracker::instance().isBuddy(getID())); + bool is_friend = (fRlvShowAvName) && isInBuddyList(); // [/RLVa:KB] bool is_cloud = getIsCloud(); @@ -3581,7 +3583,7 @@ bool LLVOAvatar::isVisuallyMuted() return muted; } -bool LLVOAvatar::isInMuteList() +bool LLVOAvatar::isInMuteList() const { bool muted = false; F64 now = LLFrameTimer::getTotalSeconds(); @@ -3600,6 +3602,25 @@ bool LLVOAvatar::isInMuteList() return muted; } +bool LLVOAvatar::isInBuddyList() const +{ + bool is_friend = false; + F64 now = LLFrameTimer::getTotalSeconds(); + if (now < mCachedBuddyListUpdateTime) + { + is_friend = mCachedInBuddyList; + } + else + { + is_friend = LLAvatarTracker::instance().isBuddy(getID()); + + const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1; + mCachedBuddyListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES; + mCachedInBuddyList = is_friend; + } + return is_friend; +} + // [RLVa:KB] - Checked: RLVa-2.2 (@setcam_avdist) bool LLVOAvatar::isRlvSilhouette() { @@ -7991,7 +8012,7 @@ bool LLVOAvatar::isTooComplex() const { static const LLCachedControl<bool> always_render_friends(gSavedSettings, "AlwaysRenderFriends", false); bool too_complex; - bool render_friend = (always_render_friends && LLAvatarTracker::instance().isBuddy(getID())); + bool render_friend = (always_render_friends && isInBuddyList()); if (isSelf() || render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER) { @@ -10606,7 +10627,7 @@ void LLVOAvatar::calcMutedAVColor() } // [/RLVa:KB] } - else if (LLMuteList::getInstance()->isMuted(av_id)) // the user blocked them + else if (isInMuteList()) // the user blocked them { // blocked avatars are dark grey new_color = LLColor4::grey4; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 0be915d70eb2b94be76a1a2e70448872b54fe02e..932e63809d5c9bebdfaaee07a16d4639f622a168 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -426,7 +426,8 @@ class LLVOAvatar : public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); bool isVisuallyMuted(); - bool isInMuteList(); + bool isInMuteList() const; + bool isInBuddyList() const; // [RLVa:KB] - Checked: RLVa-2.2 (@setcam_avdist) bool isRlvSilhouette(); // [/RLVa:KB] @@ -473,8 +474,10 @@ class LLVOAvatar : mutable bool mVisualComplexityStale; U32 mReportedVisualComplexity; // from other viewers through the simulator - bool mCachedInMuteList; - F64 mCachedMuteListUpdateTime; + mutable bool mCachedInMuteList; + mutable F64 mCachedMuteListUpdateTime; + mutable bool mCachedInBuddyList; + mutable F64 mCachedBuddyListUpdateTime; // [RLVa:KB] - Checked: RLVa-2.2 (@setcam_avdist) mutable bool mCachedIsRlvSilhouette = false; mutable F64 mCachedRlvSilhouetteUpdateTime = 0.f;