When giving inventory to someone, use preferred name and link it in log.

This commit is contained in:
Liru Færs
2019-11-03 12:30:15 -05:00
parent 021ba21b4f
commit 6048019926
2 changed files with 10 additions and 3 deletions

View File

@@ -349,9 +349,10 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im
else
{
std::string full_name;
if (gCacheName->getFullName(to_agent, full_name))
if (LLAvatarNameCache::getNSName(to_agent, full_name))
{
LLChat chat(LLTrans::getString("inventory_item_offered_to") + " " + 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);
}

View File

@@ -2217,6 +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;
@@ -2224,7 +2230,7 @@ void autoresponder_finish(bool show_autoresponded, const LLUUID& session_id, con
void cmdline_printchat(const std::string& message);
if (show_autoresponded)
{
const std::string notice(LLTrans::getString("IM_autoresponded_to") + " [secondlife:///app/agent/" + from_id.asString() + "/about " + ns_name + ']');
const std::string notice(LLTrans::getString("IM_autoresponded_to") + ' ' + getAvatarSLURL(from_id, ns_name));
is_muted ? cmdline_printchat(notice) : gIMMgr->addMessage(session_id, from_id, name, notice);
}
if (LLViewerInventoryItem* item = gInventory.getItem(itemid))