From 2b0a318facb9b698ed6818be6e0f4488cb6ba272 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Fri, 23 Aug 2024 22:41:33 +0800 Subject: Prevent arrival/departure notifs with empty names --- indra/newview/llvoavatar.cpp | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'indra') 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; } } -- cgit v1.2.3