From d996497c5e0a45e1bc68a06f4d4cdab5f706a53b Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Mon, 8 Jul 2024 08:11:26 +0300
Subject: SL-15354 Fixed object IMs not respecting chat settings

---
 indra/newview/llfloaterimnearbychathandler.cpp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index ef7ec9e950..b208ac17e7 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -643,8 +643,18 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
             }
         }
 
+        std::string user_preferences;
+        if (chat_msg.mSourceType == CHAT_SOURCE_OBJECT)
+        {
+            user_preferences = gSavedSettings.getString("NotificationObjectIMOptions");
+        }
+        else
+        {
+            user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions");
+        }
+
         //Will show toast when chat preference is set
-        if((gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") || !nearby_chat->isMessagePaneExpanded())
+        if((user_preferences == "toast") || !nearby_chat->isMessagePaneExpanded())
         {
             // Add a nearby chat toast.
             LLUUID id;
-- 
cgit v1.2.3