summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorAnkur Ahlawat <anchor@lindenlab.com>2018-03-07 10:00:07 -0800
committerAnkur Ahlawat <anchor@lindenlab.com>2018-03-07 10:00:07 -0800
commitac558e384214e22b4a8da2045854e2180b7428bf (patch)
tree7de576ff5552cbb9956c6cdf0e4d84b52514316e /indra/newview/llviewerobject.cpp
parent485193c7f530fa3d8574c74304e452ab6d012e41 (diff)
parentf8c76535a35aaf245e261357a59e977bac5b2501 (diff)
Merged lindenlab/viewer-release into default
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index ef5b5eef20..1fef20c94f 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -270,7 +270,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
mPhysicsShapeUnknown(true),
mAttachmentItemID(LLUUID::null),
mLastUpdateType(OUT_UNKNOWN),
- mLastUpdateCached(FALSE)
+ mLastUpdateCached(FALSE),
+ mCachedMuteListUpdateTime(0),
+ mCachedOwnerInMuteList(false)
{
if (!is_global)
{
@@ -5164,6 +5166,30 @@ void LLViewerObject::updateText()
}
}
+bool LLViewerObject::isOwnerInMuteList(LLUUID id)
+{
+ LLUUID owner_id = id.isNull() ? mOwnerID : id;
+ if (isAvatar() || owner_id.isNull())
+ {
+ return false;
+ }
+ bool muted = false;
+ F64 now = LLFrameTimer::getTotalSeconds();
+ if (now < mCachedMuteListUpdateTime)
+ {
+ muted = mCachedOwnerInMuteList;
+ }
+ else
+ {
+ muted = LLMuteList::getInstance()->isMuted(owner_id);
+
+ const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1;
+ mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES;
+ mCachedOwnerInMuteList = muted;
+ }
+ return muted;
+}
+
LLVOAvatar* LLViewerObject::asAvatar()
{
return NULL;