summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-23 22:41:33 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-23 22:41:33 +0800
commit2b0a318facb9b698ed6818be6e0f4488cb6ba272 (patch)
tree5b7e16b34ba1d5effb62f68960ed836267682793
parentc729a1a21c0079b9e47cbc0b44df75c93bcb5383 (diff)
Prevent arrival/departure notifs with empty names
-rw-r--r--indra/newview/llvoavatar.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 9dea345954..5c6b74900f 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -812,17 +812,20 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c
//------------------------------------------------------------------------
LLVOAvatar::~LLVOAvatar()
{
- if (gSavedSettings.getBOOL("IMShowArrivalsDepartures") && !getFullname().empty())
+ if (gSavedSettings.getBOOL("IMShowArrivalsDepartures"))
{
LLAvatarName av_name;
LLAvatarNameCache::get(getID(), &av_name);
auto display_name = av_name.getDisplayName();
- LLChat chat{llformat("%s left.", display_name.c_str())};
- chat.mFromName = display_name;
- chat.mFromID = getID();
- LLSD args;
- args["COLOR"] = "ChatHistoryTextColor";
- LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+ if (!display_name.empty())
+ {
+ LLChat chat{llformat("%s left.", display_name.c_str())};
+ chat.mFromName = display_name;
+ chat.mFromID = getID();
+ LLSD args;
+ args["COLOR"] = "ChatHistoryTextColor";
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+ }
}
if (!mFullyLoaded)
{
@@ -2489,12 +2492,15 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
LLAvatarName av_name;
LLAvatarNameCache::get(getID(), &av_name);
auto display_name = av_name.getDisplayName();
- LLChat chat{llformat("%s arrived (%.1f m).", display_name.c_str(), dist_vec(*pos_it, gAgent.getPositionGlobal()))};
- chat.mFromName = display_name;
- chat.mFromID = getID();
- LLSD args;
- args["COLOR"] = "ChatHistoryTextColor";
- LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+ if (!display_name.empty())
+ {
+ LLChat chat{llformat("%s arrived (%.1f m).", display_name.c_str(), dist_vec(*pos_it, gAgent.getPositionGlobal()))};
+ chat.mFromName = display_name;
+ chat.mFromID = getID();
+ LLSD args;
+ args["COLOR"] = "ChatHistoryTextColor";
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
+ }
break;
}
}