BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) const { // for objects, check for muting on their parent prim 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); if (mute_it != mMutes.end()) { // If any of the flags the caller passed are set, this item isn't considered muted for this caller. if(flags & mute_it->mFlags) { return FALSE; } return TRUE; } // empty names can't be legacy-muted if (name.empty()) return FALSE; // Look in legacy pile string_set_t::const_iterator legacy_it = mLegacyMutes.find(name); return legacy_it != mLegacyMutes.end(); }
LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) : mID(id), mName(name), mType(type), mFlags(flags) { // muting is done by root objects only - try to find this objects root LLViewerObject* mute_object = get_object_to_mute_from_id(id); if(mute_object && mute_object->getID() != id) { mID = mute_object->getID(); LLNameValue* firstname = mute_object->getNVPair("FirstName"); LLNameValue* lastname = mute_object->getNVPair("LastName"); if (firstname && lastname) { mName = LLCacheName::buildFullName( firstname->getString(), lastname->getString()); } mType = mute_object->isAvatar() ? AGENT : OBJECT; } }