When giving inventory to someone, use preferred name and link it in log.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user