summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerchat.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2025-04-25 22:31:53 +0300
committerGitHub <noreply@github.com>2025-04-25 22:31:53 +0300
commit17e974689c76a2b76cf27e3a1c9dde371f4f877f (patch)
treeef2c959fa556b19407d72ccc581cc9e55d1bb525 /indra/newview/llviewerchat.cpp
parent25c11f09655db011d27fec6887854d1200f63b19 (diff)
parent1eb34b43fb88a0b7551d9083ab46ba7df2feab14 (diff)
Merge pull request #3943 from secondlife/maxim/2025.04-chat-mention
#3758 initial chat mention support
Diffstat (limited to 'indra/newview/llviewerchat.cpp')
-rw-r--r--indra/newview/llviewerchat.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index 8b01c4ef88..2ca2c5c07d 100644
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -36,6 +36,7 @@
#include "llviewerregion.h"
#include "llworld.h"
#include "llinstantmessage.h" //SYSTEM_FROM
+#include "llurlregistry.h"
// LLViewerChat
LLViewerChat::font_change_signal_t LLViewerChat::sChatFontChangedSignal;
@@ -222,6 +223,13 @@ void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg)
{
std::string tmpmsg = chat.mText;
+ // show @name instead of slurl for chat mentions
+ LLUrlMatch match;
+ while (LLUrlRegistry::instance().findUrl(tmpmsg, match, LLUrlRegistryNullCallback, false, true))
+ {
+ tmpmsg.replace(match.getStart(), match.getEnd() - match.getStart() + 1, match.getLabel());
+ }
+
if(chat.mChatStyle == CHAT_STYLE_IRC)
{
formated_msg = chat.mFromName + tmpmsg.substr(3);