Links for teleport offers, show autoresponded with item to muted in local,
autounmute notification (so you can remute easily :P).

Cleanup redundant strings
This commit is contained in:
Liru Færs
2019-11-03 12:39:48 -05:00
parent 6048019926
commit d189aadd12
10 changed files with 29 additions and 53 deletions

View File

@@ -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)
// <edit>
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"));
// </edit>
}
@@ -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);
}