FIRE-19760: In Help/About Firestorm server release notes not getting fetched

meow-7.2.2
Ansariel 2016-08-06 15:16:58 +02:00
parent 4d1f1b8d5d
commit 025a844c67
1 changed files with 45 additions and 3 deletions

View File

@ -110,6 +110,9 @@ public:
static void startFetchServerReleaseNotes();
static void handleServerReleaseNotes(LLSD results);
// <FS:Ansariel> FIRE-19760: In Help/About Firestorm server release notes not getting fetched
static void fetchServerReleaseNotesCoro(const std::string& cap_url);
};
@ -227,9 +230,11 @@ void LLFloaterAbout::startFetchServerReleaseNotes()
// an URL suitable for external browsers in the "Location:" HTTP header.
std::string cap_url = region->getCapability("ServerReleaseNotes");
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(cap_url,
&LLFloaterAbout::handleServerReleaseNotes, &LLFloaterAbout::handleServerReleaseNotes);
// <FS:Ansariel> FIRE-19760: In Help/About Firestorm server release notes not getting fetched
//LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(cap_url,
// &LLFloaterAbout::handleServerReleaseNotes, &LLFloaterAbout::handleServerReleaseNotes);
LLCoros::instance().launch("fetchServerReleaseNotesCoro", boost::bind(&LLFloaterAbout::fetchServerReleaseNotesCoro, cap_url));
// </FS:Ansariel>
}
/*static*/
@ -256,8 +261,45 @@ void LLFloaterAbout::handleServerReleaseNotes(LLSD results)
}
LLAppViewer::instance()->setServerReleaseNotesURL(location);
// }
// <FS:Ansariel> FIRE-19760: In Help/About Firestorm server release notes not getting fetched
LLFloaterAbout* floater_about = LLFloaterReg::findTypedInstance<LLFloaterAbout>("sl_about");
if (floater_about)
{
floater_about->setSupportText(location);
}
// </FS:Ansariel>
}
// <FS:Ansariel> FIRE-19760: In Help/About Firestorm server release notes not getting fetched
/*static*/
void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string& cap_url)
{
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("fetchServerReleaseNotesCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
LLSD result = httpAdapter->getAndSuspend(httpRequest, cap_url, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
if (!status)
{
handleServerReleaseNotes(httpResults);
}
else
{
handleServerReleaseNotes(result);
}
// </FS:Ansariel>
}
class LLFloaterAboutListener: public LLEventAPI
{
public: