diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-09-04 20:56:11 +0300 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-04 23:10:38 +0300 |
commit | f5c872a12dc5c8e47f61b80056d21f90da2cd689 (patch) | |
tree | c04716e3408b45caa80b141da6a6629ca1b7a871 | |
parent | a4f58810f4c4f6e66246426aa3ca120e713049e0 (diff) |
p#470 Fix wrong release notes being shown.
-rw-r--r-- | indra/newview/llstartup.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5df7eca5f5..bf7c58a3cb 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -57,6 +57,7 @@ #include "lllocationhistory.h" #include "llgltfmateriallist.h" #include "llimageworker.h" +#include "llregex.h" #include "llloginflags.h" #include "llmd5.h" @@ -2558,6 +2559,27 @@ void release_notes_coro(const std::string url) LLWeb::loadURLInternal(url); } +void validate_release_notes_coro(const std::string url) +{ + LLVersionInfo& versionInfo(LLVersionInfo::instance()); + const boost::regex version_regex(R"(\b\d+\.\d+\.\d+\.\d+\b)"); + + if (url.find(versionInfo.getVersion()) == std::string::npos // has no our build version + && ll_regex_search(url, version_regex)) // has any version + { + LL_INFOS() << "Received release notes url \"" << url << "\" wwith mismatching build, falling back to locally generated url" << LL_ENDL; + // Updater only provides notes for a most recent version, if it is not + // the current one, fall back to the hardcoded URL. + LLSD info(LLAppViewer::instance()->getViewerInfo()); + std::string alt_url = info["VIEWER_RELEASE_NOTES_URL"].asString(); + release_notes_coro(alt_url); + } + else + { + release_notes_coro(url); + } +} + /** * Check if user is running a new version of the viewer. * Display the Release Notes if it's not overriden by the "UpdaterShowReleaseNotes" setting. @@ -2591,7 +2613,7 @@ void show_release_notes_if_required() "showrelnotes", [](const LLSD& url) { LLCoros::instance().launch("releaseNotesCoro", - boost::bind(&release_notes_coro, url.asString())); + boost::bind(&validate_release_notes_coro, url.asString())); return false; }); } |