diff options
author | Mark Palange <palange@lindenlab.com> | 2009-02-03 21:15:57 +0000 |
---|---|---|
committer | Mark Palange <palange@lindenlab.com> | 2009-02-03 21:15:57 +0000 |
commit | 46f8fb8781ccce338b4a88aaf8371ee3dec56d29 (patch) | |
tree | b2dc09521a166d2181c48f4a4f1ca90b83b99477 /indra/newview/llmutelist.cpp | |
parent | e188badaf29a1a02307f93864eed6737096bd9a1 (diff) |
svn merge -r107016:108767 svn+ssh://svn.lindenlab.com/svn/linden/viewer/viewer_1-22
Merge back of viewer 1.22 RC6 and RC7 change to trunk.
QAR-1214 and QAR-1227
Diffstat (limited to 'indra/newview/llmutelist.cpp')
-rw-r--r-- | indra/newview/llmutelist.cpp | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index d0993e7dca..bfcba59975 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -73,6 +73,24 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" +namespace +{ + // This method is used to return an object to mute given an object id. + // Its used by the LLMute constructor and LLMuteList::isMuted. + LLViewerObject* get_object_to_mute_from_id(LLUUID object_id) + { + LLViewerObject *objectp = gObjectList.findObject(object_id); + if ((objectp) && (!objectp->isAvatar())) + { + LLViewerObject *parentp = (LLViewerObject *)objectp->getParent(); + if (parentp && parentp->getID() != gAgent.getID()) + { + objectp = parentp; + } + } + return objectp; + } +} // "emptymutelist" class LLDispatchEmptyMuteList : public LLDispatchHandler @@ -107,15 +125,21 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) mFlags(flags) { // muting is done by root objects only - try to find this objects root - LLViewerObject *objectp = gObjectList.findObject(mID); - if ((objectp) && (!objectp->isAvatar())) + LLViewerObject* mute_object = get_object_to_mute_from_id(id); + if(mute_object && mute_object->getID() != id) { - LLViewerObject *parentp = (LLViewerObject *)objectp->getParent(); - if (parentp) + mID = mute_object->getID(); + LLNameValue* firstname = mute_object->getNVPair("FirstName"); + LLNameValue* lastname = mute_object->getNVPair("LastName"); + if (firstname && lastname) { - mID = parentp->getID(); + mName.assign( firstname->getString() ); + mName.append(" "); + mName.append( lastname->getString() ); } + mType = mute_object->isAvatar() ? AGENT : OBJECT; } + } @@ -664,19 +688,10 @@ BOOL LLMuteList::saveToFile(const std::string& filename) BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) const { - LLUUID id_to_check = id; - // for objects, check for muting on their parent prim - LLViewerObject *objectp = gObjectList.findObject(id); - if ((objectp) && (!objectp->isAvatar())) - { - LLViewerObject *parentp = (LLViewerObject *)objectp->getParent(); - if (parentp) - { - id_to_check = parentp->getID(); - } - } - + LLViewerObject* mute_object = get_object_to_mute_from_id(id); + LLUUID id_to_check = (mute_object) ? mute_object->getID() : id; + // don't need name or type for lookup LLMute mute(id_to_check); mute_set_t::const_iterator mute_it = mMutes.find(mute); |