diff options
author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2025-08-29 12:48:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-29 12:48:44 -0400 |
commit | 842ac1e1503e41662c924289905b43b336b52a53 (patch) | |
tree | d8067fc99f6c699e3d15510c8521a32102f5cb30 /indra/llui/llurlaction.cpp | |
parent | 28678996ceaea019aafaa26911a440769320c498 (diff) | |
parent | 787b63f4c29f6ef56f355ec80084458a1bbcfb35 (diff) |
Merge pull request #4379 from secondlife/release/2025.06
Release/2025.06
Diffstat (limited to 'indra/llui/llurlaction.cpp')
-rw-r--r-- | indra/llui/llurlaction.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index b6b450c2a1..fdae22cfa1 100644 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -30,6 +30,7 @@ #include "llview.h" #include "llwindow.h" #include "llurlregistry.h" +#include "v3dmath.h" // global state for the callback functions @@ -128,6 +129,23 @@ void LLUrlAction::showLocationOnMap(std::string url) } } +void LLUrlAction::showParcelOnMap(std::string url) +{ + LLSD path_array = LLURI(url).pathArray(); + auto path_parts = path_array.size(); + + if (path_parts < 3) // no parcel id + { + LL_WARNS() << "Global coordinates are missing in url: [" << url << "]" << LL_ENDL; + return; + } + + LLVector3d parcel_pos = LLUrlEntryParcel::getParcelPos(LLUUID(LLURI::unescape(path_array[2]))); + std::ostringstream pos; + pos << parcel_pos.mdV[VX] << '/' << parcel_pos.mdV[VY] << '/' << parcel_pos.mdV[VZ]; + executeSLURL("secondlife:///app/worldmap_global/" + pos.str()); +} + void LLUrlAction::copyURLToClipboard(std::string url) { LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(url)); @@ -142,6 +160,16 @@ void LLUrlAction::copyLabelToClipboard(std::string url) } } +std::string LLUrlAction::getURLLabel(std::string url) +{ + LLUrlMatch match; + if (LLUrlRegistry::instance().findUrl(url, match)) + { + return match.getLabel(); + } + return ""; +} + void LLUrlAction::showProfile(std::string url) { // Get id from 'secondlife:///app/{cmd}/{id}/{action}' |