summaryrefslogtreecommitdiff
path: root/indra/llui/llurlregistry.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-05-16 19:05:57 -0400
committerGitHub <noreply@github.com>2025-05-16 19:05:57 -0400
commitbb76eae4b814e612ff2b0c62fffc6c3263058d64 (patch)
tree32818e0c938b465bf39c976955864a14b3bb512e /indra/llui/llurlregistry.cpp
parent2efe514f14a0f0b405599301a14413edfce873ee (diff)
parentd5313e7161bb99045adc4a1a34d7f85de609d97b (diff)
Merge branch 'release/2025.04' into geenz/gltf-mesh-import
Diffstat (limited to 'indra/llui/llurlregistry.cpp')
-rw-r--r--indra/llui/llurlregistry.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 02d88c83fb..cb101d325d 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -327,3 +327,30 @@ void LLUrlRegistry::setKeybindingHandler(LLKeyBindingToStringHandler* handler)
LLUrlEntryKeybinding *entry = (LLUrlEntryKeybinding*)mUrlEntryKeybinding;
entry->setHandler(handler);
}
+
+bool LLUrlRegistry::containsAgentMention(const std::string& text)
+{
+ // avoid costly regexes if there is clearly no URL in the text
+ if (!stringHasUrl(text))
+ {
+ return false;
+ }
+
+ try
+ {
+ boost::sregex_iterator it(text.begin(), text.end(), mUrlEntryAgentMention->getPattern());
+ boost::sregex_iterator end;
+ for (; it != end; ++it)
+ {
+ if (mUrlEntryAgentMention->isAgentID(it->str()))
+ {
+ return true;
+ }
+ }
+ }
+ catch (boost::regex_error&)
+ {
+ LL_INFOS() << "Regex error for: " << text << LL_ENDL;
+ }
+ return false;
+}