@shownames - a couple of bugs in spoofing object handling
Issue #136
new
Here’s part of llviewermessage.cpp
if (from_id != gAgent.getID() && gAgent.mRRInterface.mContainsShownames)
{
// Special case : if the object is an attachment and imitates the name of its owner, scramble its name as if it were an agent
if (chatter && !chatter->isAvatar())
{
if (chatter->isAttachment())
{
LLAvatarName av_name;
if (LLAvatarNameCache::get(owner_id, &av_name))
{
if (from_name == av_name.mDisplayName
|| from_name == av_name.mLegacyFirstName + " " + av_name.mLegacyLastName
|| from_name == av_name.mLegacyFirstName
|| from_name == av_name.mLegacyLastName
)
{
from_name = gAgent.mRRInterface.getDummyName(from_name, chat.mAudible);
}
}
}
}
// also scramble the name of the chatter (replace with a dummy name)
if (chatter && chatter->isAvatar())
{
std::string uuid_str = chatter->getID().asString();
LLStringUtil::toLower(uuid_str);
if (gAgent.mRRInterface.containsWithoutException("shownames", uuid_str))
{
from_name = gAgent.mRRInterface.getDummyName(from_name, chat.mAudible);
}
else from_name = chat.mFromName; // KKA-635 stop bonus 'Resident' appearing
}
else
{
from_name = gAgent.mRRInterface.getCensoredMessage(from_name);
}
chat.mFromName = from_name;
}
There are two bugs here. The first is that speaking HUDs will not have chatter valid, so they fail to be picked up by the speaking attachment test. The second is that if an attachment was picked up in the speaking attachment test, the return from getDummyName will get stomped by the call to getCensoredMessage that forms the else clause to the test for isAvatar()