diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-05-08 07:43:08 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-05-08 07:43:08 +0000 |
commit | a4000c3744e42fcbb638e742f3b63fa31a0dee15 (patch) | |
tree | 7f472c30e65bbfa04ee9bc06631a1af305cc31fb /indra/newview/llmutelist.cpp | |
parent | 6c4cadbb04d633ad7b762058bdeba6e1f650dafd (diff) |
merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7
Diffstat (limited to 'indra/newview/llmutelist.cpp')
-rw-r--r-- | indra/newview/llmutelist.cpp | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 841330483c..4ec2faf957 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -72,6 +72,7 @@ #include "lluistring.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" +#include "lltrans.h" namespace { @@ -112,11 +113,6 @@ static LLDispatchEmptyMuteList sDispatchEmptyMuteList; //----------------------------------------------------------------------------- // LLMute() //----------------------------------------------------------------------------- -const char BY_NAME_SUFFIX[] = " (by name)"; -const char AGENT_SUFFIX[] = " (resident)"; -const char OBJECT_SUFFIX[] = " (object)"; -const char GROUP_SUFFIX[] = " (group)"; - LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) : mID(id), @@ -150,16 +146,16 @@ std::string LLMute::getDisplayName() const { case BY_NAME: default: - name_with_suffix += BY_NAME_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteByName"); break; case AGENT: - name_with_suffix += AGENT_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteAgent"); break; case OBJECT: - name_with_suffix += OBJECT_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteObject"); break; case GROUP: - name_with_suffix += GROUP_SUFFIX; + name_with_suffix += " " + LLTrans::getString("MuteGroup"); break; } return name_with_suffix; @@ -170,7 +166,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) size_t pos = 0; mName = display_name; - pos = mName.rfind(GROUP_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteGroup")); if (pos != std::string::npos) { mName.erase(pos); @@ -178,7 +174,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) return; } - pos = mName.rfind(OBJECT_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteObject")); if (pos != std::string::npos) { mName.erase(pos); @@ -186,7 +182,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) return; } - pos = mName.rfind(AGENT_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteAgent")); if (pos != std::string::npos) { mName.erase(pos); @@ -194,7 +190,7 @@ void LLMute::setFromDisplayName(const std::string& display_name) return; } - pos = mName.rfind(BY_NAME_SUFFIX); + pos = mName.rfind(" " + LLTrans::getString("MuteByName")); if (pos != std::string::npos) { mName.erase(pos); @@ -502,11 +498,8 @@ void LLMuteList::updateRemove(const LLMute& mute) gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, void* user_data) +void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, LLMuteList::EAutoReason reason) { - U32 temp_data = (U32) (uintptr_t) user_data; - LLMuteList::EAutoReason reason = (LLMuteList::EAutoReason)temp_data; - std::string auto_message; switch (reason) { @@ -522,8 +515,8 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n break; } - std::string message = LLNotification::format(auto_message, - LLSD().insert("FIRST", first_name).insert("LAST", last_name)); + std::string message = auto_message; + LLStringUtil::format(message, LLSD().insert("FIRST", first_name).insert("LAST", last_name)); if (reason == LLMuteList::AR_IM) { @@ -555,18 +548,18 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, co if (gCacheName->getName(agent_id, cache_first, cache_last)) { // name in cache, call callback directly - notify_automute_callback(agent_id, cache_first, cache_last, FALSE, (void *)reason); + notify_automute_callback(agent_id, cache_first, cache_last, FALSE, reason); } else { // not in cache, lookup name from cache - gCacheName->get(agent_id, FALSE, notify_automute_callback, (void *)reason); + gCacheName->get(agent_id, FALSE, boost::bind(¬ify_automute_callback, _1, _2, _3, _4, reason)); } } else { // call callback directly - notify_automute_callback(agent_id, first_name, last_name, FALSE, (void *)reason); + notify_automute_callback(agent_id, first_name, last_name, FALSE, reason); } } |