diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 145f3c9fe..c70eec31b 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -705,7 +705,7 @@ void fake_local_chat(std::string msg) chat.mSourceType = CHAT_SOURCE_SYSTEM; if (rlv_handler_t::isEnabled()) chat.mRlvLocFiltered = chat.mRlvNamesFiltered = true; chat.mPosAgent = gAgent.getPositionAgent(); - chat.mURL = "secondlife:///app/agent/" + gAgentID.asString() + "/about"; + chat.mURL = LLAvatarActions::getSLURL(gAgentID); if (action) chat.mChatStyle = CHAT_STYLE_IRC; if (!LLAvatarNameCache::getNSName(gAgentID, chat.mFromName)) { diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index ee5170721..fce835651 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -470,7 +470,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, std::string text = LLTrans::getString("CompileQueueProblemUploading"); LLChat chat(text); LLFloaterChat::addChat(chat); - buffer = text + LLTrans::getString(":") + " " + data->mScriptName; + buffer = text + LLTrans::getString(":") + ' ' + data->mScriptName; LL_WARNS() << "Problem uploading script asset." << LL_ENDL; if(queue) queue->removeItemByItemID(data->mItemId); } @@ -485,18 +485,18 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, LLChat chat(LLTrans::getString("CompileQueueScriptNotFound")); LLFloaterChat::addChat(chat); - buffer = LLTrans::getString("CompileQueueProblemDownloading") + LLTrans::getString(":") + " " + data->mScriptName; + buffer = LLTrans::getString("CompileQueueProblemDownloading") + LLTrans::getString(":") + ' ' + data->mScriptName; } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { LLChat chat(LLTrans::getString("CompileQueueInsufficientPermDownload")); LLFloaterChat::addChat(chat); - buffer = LLTrans::getString("CompileQueueInsufficientPermFor") + LLTrans::getString(":") + " " + data->mScriptName; + buffer = LLTrans::getString("CompileQueueInsufficientPermFor") + LLTrans::getString(":") + ' ' + data->mScriptName; } else { - buffer = LLTrans::getString("CompileQueueUnknownFailure") + (" ") + data->mScriptName; + buffer = LLTrans::getString("CompileQueueUnknownFailure") + ' ' + data->mScriptName; } LL_WARNS() << "Problem downloading script asset." << LL_ENDL; @@ -590,7 +590,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); std::string buffer; - buffer = getString("Resetting") + LLTrans::getString(":") + " " + item->getName(); + buffer = getString("Resetting") + LLTrans::getString(":") + ' ' + item->getName(); getChild("queue output")->addSimpleElement(buffer, ADD_BOTTOM); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_ScriptReset); @@ -650,7 +650,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); LLScrollListCtrl* list = getChild("queue output"); std::string buffer; - buffer = getString("Running") + LLTrans::getString(":") + " " + item->getName(); + buffer = getString("Running") + LLTrans::getString(":") + ' ' + item->getName(); list->addSimpleElement(buffer, ADD_BOTTOM); LLMessageSystem* msg = gMessageSystem; @@ -750,7 +750,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); LLScrollListCtrl* list = getChild("queue output"); std::string buffer; - buffer = getString("NotRunning") + LLTrans::getString(":") + " " + item->getName(); + buffer = getString("NotRunning") + LLTrans::getString(":") + ' ' + item->getName(); list->addSimpleElement(buffer, ADD_BOTTOM); LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 9d6264f3c..0f90007f0 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -114,7 +114,7 @@ namespace chat.mFromName = name; chat.mFromID = key; if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) // RLVa:LF - No way! - chat.mURL = llformat("secondlife:///app/agent/%s/about", key.asString().c_str()); + chat.mURL = LLAvatarActions::getSLURL(key); chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChat(chat); } diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index c1bf51012..712d50167 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -51,6 +51,7 @@ // project include #include "ascentkeyword.h" #include "llagent.h" +#include "llavataractions.h" #include "llchatbar.h" #include "llconsole.h" #include "llfloaterchatterbox.h" @@ -195,7 +196,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) // [/RLVa:KB] { - chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str()); + chat.mURL = LLAvatarActions::getSLURL(chat.mFromID); } if (chat.mSourceType == CHAT_SOURCE_OBJECT) diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index fc76c46d7..73bc6cd83 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -36,6 +36,7 @@ #include "llagentdata.h" #include "llagentui.h" #include "llagentwearables.h" +#include "llavataractions.h" #include "llfloaterchat.h" //for addChatHistory #include "llfloatertools.h" // for gFloaterTool #include "llhudeffecttrail.h" @@ -348,14 +349,9 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im // If this item was given by drag-and-drop on avatar while IM panel wasn't open, log this action to IM history. else { - std::string full_name; - if (LLAvatarNameCache::getNSName(to_agent, full_name)) - { - std::string getAvatarSLURL(const LLUUID& id, const std::string& name); - LLChat chat(LLTrans::getString("inventory_item_offered_to") + ' ' + getAvatarSLURL(to_agent, full_name)); - chat.mSourceType = CHAT_SOURCE_SYSTEM; - LLFloaterChat::addChatHistory(chat); - } + LLChat chat(LLTrans::getString("inventory_item_offered_to") + ' ' + LLAvatarActions::getSLURL(to_agent)); + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChatHistory(chat); } } diff --git a/indra/newview/llmediaremotectrl.cpp b/indra/newview/llmediaremotectrl.cpp index e4055c567..e6d0aece1 100644 --- a/indra/newview/llmediaremotectrl.cpp +++ b/indra/newview/llmediaremotectrl.cpp @@ -289,7 +289,7 @@ void LLMediaRemoteCtrl::enableMediaButtons() { sLastTooltip = info_text; LLChat chat; - chat.mText = getString("Now_playing") + " " + info_text; + chat.mText = getString("Now_playing") + ' ' + info_text; chat.mSourceType = CHAT_SOURCE_SYSTEM; // Lie to RLVa so it won't filter this chat.mRlvLocFiltered = true; diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index f6ebe00bf..efe7230c8 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -58,6 +58,7 @@ #include "llxfermanager.h" #include "llagent.h" +#include "llavataractions.h" #include "llviewergenericmessage.h" // for gGenericDispatcher #include "llworld.h" //for particle system banning #include "llfloaterchat.h" @@ -458,7 +459,7 @@ void LLMuteList::updateRemove(const LLMute& mute) gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const std::string& full_name, bool is_group, LLMuteList::EAutoReason reason) +static void notify_automute_callback(const LLUUID& agent_id, const LLMuteList::EAutoReason& reason) { std::string notif_name; switch (reason) @@ -475,11 +476,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& full_na break; } - LLSD args; - args["NAME"] = full_name; - - LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD()); - if (notif_ptr) + if (auto notif_ptr = LLNotifications::instance().add(notif_name, LLSD().with("NAME", LLAvatarActions::getSLURL(agent_id)), LLSD())) { std::string message = notif_ptr->getMessage(); @@ -506,18 +503,7 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason) removed = TRUE; remove(automute); - std::string full_name; - if (gCacheName->getFullName(agent_id, full_name)) - { - // name in cache, call callback directly - notify_automute_callback(agent_id, full_name, false, reason); - } - else - { - // not in cache, lookup name from cache - gCacheName->get(agent_id, false, - boost::bind(¬ify_automute_callback, _1, _2, _3, reason)); - } + notify_automute_callback(agent_id, reason); } return removed; diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index ff6159e4e..fb6dad7a2 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llstylemap.h" +#include "llavataractions.h" LLStyleMap::LLStyleMap() { @@ -59,8 +60,7 @@ const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source) if (source.notNull()) { style->setColor(gSavedSettings.getColor4("HTMLAgentColor")); - std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str()); - style->setLinkHREF(link); + style->setLinkHREF(LLAvatarActions::getSLURL(source)); } (*this)[source] = style; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5ac2ef3e6..753c99ecd 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2217,20 +2217,12 @@ std::string replace_wildcards(std::string input, const LLUUID& id, const std::st return input; } -std::string getAvatarSLURL(const LLUUID& id, const std::string& name) -{ - auto ret = llformat("secondlife:///app/agent/%s/about", id.asString().data()); - return name.empty() ? ret : ('[' + ret + ' ' + name + ']'); -} - void autoresponder_finish(bool show_autoresponded, const LLUUID& session_id, const LLUUID& from_id, const std::string& name, const LLUUID& itemid, bool is_muted) { - LLAvatarName av_name; - const std::string ns_name(LLAvatarNameCache::get(from_id, &av_name) ? av_name.getNSName() : name); void cmdline_printchat(const std::string& message); if (show_autoresponded) { - const std::string notice(LLTrans::getString("IM_autoresponded_to") + ' ' + getAvatarSLURL(from_id, ns_name)); + const std::string notice(LLTrans::getString("IM_autoresponded_to") + ' ' + LLAvatarActions::getSLURL(from_id)); is_muted ? cmdline_printchat(notice) : gIMMgr->addMessage(session_id, from_id, name, notice); } if (LLViewerInventoryItem* item = gInventory.getItem(itemid)) @@ -2238,7 +2230,7 @@ void autoresponder_finish(bool show_autoresponded, const LLUUID& session_id, con LLGiveInventory::doGiveInventoryItem(from_id, item, session_id); if (show_autoresponded) { - const std::string notice(llformat("%s %s \"%s\"", ns_name.c_str(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); + const std::string notice(llformat("%s %s \"%s\"", LLAvatarActions::getSLURL(from_id).data(), LLTrans::getString("IM_autoresponse_sent_item").c_str(), item->getName().c_str())); is_muted ? cmdline_printchat(notice) : gIMMgr->addMessage(session_id, from_id, name, notice); } } @@ -3374,7 +3366,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // if (IM_LURE_USER == dialog) - gAgent.showLureDestination(name, region_handle, pos.mV[VX], pos.mV[VY], pos.mV[VZ]); + gAgent.showLureDestination(LLAvatarActions::getSLURL(from_id), region_handle, pos.mV[VX], pos.mV[VY], pos.mV[VZ]); script_msg_api(from_id.asString().append(IM_LURE_USER == dialog ? ", 2" : ", 3")); // } @@ -7180,7 +7172,7 @@ void chat_mean_collision(const LLUUID& id, const LLAvatarName& avname, const EMe args["MAG"] = llformat("%f", mag); LLChat chat(LLTrans::getString("BumpedYou", args)); chat.mFromName = name; - chat.mURL = llformat("secondlife:///app/agent/%s/about", id.asString().c_str()); + chat.mURL = LLAvatarActions::getSLURL(id); chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChat(chat); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e59ef3eb3..f9b36e00d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -45,6 +45,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llanimationstates.h" +#include "llavataractions.h" #include "llavatarnamecache.h" #include "llavatarpropertiesprocessor.h" #include "llcontrolavatar.h" @@ -6427,8 +6428,8 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL LLAvatarNameCache::getNSName(mID, name); LLChat chat; chat.mFromName = name; - chat.mText = name + " " + LLTrans::getString("took_a_snapshot") + "."; - chat.mURL = llformat("secondlife:///app/agent/%s/about",mID.asString().c_str()); + chat.mText = name + ' ' + LLTrans::getString("took_a_snapshot") + '.'; + chat.mURL = LLAvatarActions::getSLURL(mID); chat.mSourceType = CHAT_SOURCE_SYSTEM; LLFloaterChat::addChat(chat); }