summaryrefslogtreecommitdiff
path: root/indra/llui/llurlregistry.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2025-04-23 21:01:46 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2025-04-23 21:04:47 +0300
commit17561e2ad13ec5c32e49f26e70b4ee291433db04 (patch)
treefb97d553a8c84b30ed7b6a28692f2aa5e4c08ce7 /indra/llui/llurlregistry.cpp
parentda2234a563c9dfca0ce80371167ceef08300de53 (diff)
#3758 show mention name in bubble chat
Diffstat (limited to 'indra/llui/llurlregistry.cpp')
-rw-r--r--indra/llui/llurlregistry.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 6e6e3be9b4..02d88c83fb 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -62,6 +62,8 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(new LLUrlEntryAgentUserName());
// LLUrlEntryAgent*Name must appear before LLUrlEntryAgent since
// LLUrlEntryAgent is a less specific (catchall for agent urls)
+ mUrlEntryAgentMention = new LLUrlEntryAgentMention();
+ registerUrl(mUrlEntryAgentMention);
registerUrl(new LLUrlEntryAgent());
registerUrl(new LLUrlEntryChat());
registerUrl(new LLUrlEntryGroup());
@@ -155,7 +157,7 @@ static bool stringHasUrl(const std::string &text)
text.find("@") != std::string::npos);
}
-bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted)
+bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted, bool skip_non_mentions)
{
// avoid costly regexes if there is clearly no URL in the text
if (! stringHasUrl(text))
@@ -176,6 +178,11 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
continue;
}
+ if (skip_non_mentions && (mUrlEntryAgentMention != *it))
+ {
+ continue;
+ }
+
LLUrlEntryBase *url_entry = *it;
U32 start = 0, end = 0;