diff options
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r-- | indra/newview/llavataractions.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 36e95c07f4..2045c3e297 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -478,15 +478,14 @@ void LLAvatarActions::kick(const LLUUID& id) // static void LLAvatarActions::freezeAvatar(const LLUUID& id) { - std::string fullname; - gCacheName->getFullName(id, fullname); + LLAvatarName av_name; LLSD payload; payload["avatar_id"] = id; - if (!fullname.empty()) + if (LLAvatarNameCache::get(id, &av_name)) { LLSD args; - args["AVATAR_NAME"] = fullname; + args["AVATAR_NAME"] = av_name.getUserName(); LLNotificationsUtil::add("FreezeAvatarFullname", args, payload, handleFreezeAvatar); } else @@ -498,15 +497,15 @@ void LLAvatarActions::freezeAvatar(const LLUUID& id) // static void LLAvatarActions::ejectAvatar(const LLUUID& id, bool ban_enabled) { - std::string fullname; - gCacheName->getFullName(id, fullname); + LLAvatarName av_name; LLSD payload; payload["avatar_id"] = id; payload["ban_enabled"] = ban_enabled; LLSD args; - if (!fullname.empty()) + bool has_name = LLAvatarNameCache::get(id, &av_name); + if (has_name) { - args["AVATAR_NAME"] = fullname; + args["AVATAR_NAME"] = av_name.getUserName(); } if (ban_enabled) @@ -515,7 +514,7 @@ void LLAvatarActions::ejectAvatar(const LLUUID& id, bool ban_enabled) } else { - if (!fullname.empty()) + if (has_name) { LLNotificationsUtil::add("EjectAvatarFullnameNoBan", args, payload, handleEjectAvatar); } @@ -991,10 +990,10 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL // static void LLAvatarActions::toggleBlock(const LLUUID& id) { - std::string name; + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); - gCacheName->getFullName(id, name); // needed for mute - LLMute mute(id, name, LLMute::AGENT); + LLMute mute(id, av_name.getUserName(), LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { @@ -1009,13 +1008,13 @@ void LLAvatarActions::toggleBlock(const LLUUID& id) // static void LLAvatarActions::toggleMuteVoice(const LLUUID& id) { - std::string name; - gCacheName->getFullName(id, name); // needed for mute + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); LLMuteList* mute_list = LLMuteList::getInstance(); bool is_muted = mute_list->isMuted(id, LLMute::flagVoiceChat); - LLMute mute(id, name, LLMute::AGENT); + LLMute mute(id, av_name.getUserName(), LLMute::AGENT); if (!is_muted) { mute_list->add(mute, LLMute::flagVoiceChat); @@ -1329,9 +1328,9 @@ bool LLAvatarActions::isFriend(const LLUUID& id) // static bool LLAvatarActions::isBlocked(const LLUUID& id) { - std::string name; - gCacheName->getFullName(id, name); // needed for mute - return LLMuteList::getInstance()->isMuted(id, name); + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); + return LLMuteList::getInstance()->isMuted(id, av_name.getUserName()); } // static @@ -1343,8 +1342,10 @@ bool LLAvatarActions::isVoiceMuted(const LLUUID& id) // static bool LLAvatarActions::canBlock(const LLUUID& id) { - std::string full_name; - gCacheName->getFullName(id, full_name); // needed for mute + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); + + std::string full_name = av_name.getUserName(); bool is_linden = (full_name.find("Linden") != std::string::npos); bool is_self = id == gAgentID; return !is_self && !is_linden; |