diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-02-14 20:36:34 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-02-14 20:36:34 +0200 |
commit | fb085b8e61832bfc5222636f96fb802cec5ca9a2 (patch) | |
tree | 177207f3e5ba3c37c042a55c67f2099362e76d01 /indra/newview | |
parent | ffc64187940c5df230d9dcead5c8716c10f109a9 (diff) |
SL-1005 Changed media event is not firing when the URL is amended by a '#' since Alex-Ivy
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f4e1524371..d8745b1eca 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3320,8 +3320,39 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla } else { - // Don't track redirects. - setNavState(MEDIANAVSTATE_NONE); + bool internal_nav = false; + if (url != mCurrentMediaURL) + { + // Check if it is internal navigation + // Note: Not sure if we should detect internal navigations as 'address change', + // but they are not redirects and do not cause NAVIGATE_BEGIN (also see SL-1005) + size_t pos = url.find("#"); + if (pos != std::string::npos) + { + // assume that new link always have '#', so this is either + // transfer from 'link#1' to 'link#2' or from link to 'link#2' + // filter out cases like 'redirect?link' + std::string base_url = url.substr(0, pos); + pos = mCurrentMediaURL.find(base_url); + if (pos == 0) + { + // base link hasn't changed + internal_nav = true; + } + } + } + + if (internal_nav) + { + // Internal navigation by '#' + mCurrentMediaURL = url; + setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); + } + else + { + // Don't track redirects. + setNavState(MEDIANAVSTATE_NONE); + } } } break; |