Adding llagentlanguage to new LLCore::Http code moved some of llappearancemgr handling into llAgent.

master
Rider Linden 2015-03-26 16:41:16 -07:00
parent 97b9317969
commit b9e8080709
3 changed files with 10 additions and 39 deletions

View File

@ -32,6 +32,7 @@
#include "llviewerregion.h"
// library includes
#include "llui.h" // getLanguage()
#include "httpcommon.h"
// static
void LLAgentLanguage::init()
@ -69,7 +70,12 @@ bool LLAgentLanguage::update()
body["language"] = language;
body["language_is_public"] = gSavedSettings.getBOOL("LanguageIsPublic");
LLHTTPClient::post(url, body, new LLHTTPClient::Responder);
//LLHTTPClient::post(url, body, new LLHTTPClient::Responder);
LLCore::HttpHandle handle = gAgent.requestPostCapibility("UpdateAgentLanguage", url, body);
if (handle == LLCORE_HTTP_HANDLE_INVALID)
{
LL_WARNS() << "Unable to change language." << LL_ENDL;
}
}
return true;
}

View File

@ -3442,17 +3442,12 @@ void LLAppearanceMgr::requestServerAppearanceUpdate()
llassert(cof_version >= gAgentAvatarp->mLastUpdateRequestCOFVersion);
gAgentAvatarp->mLastUpdateRequestCOFVersion = cof_version;
// *TODO: use the unified call in LLAgent (?)
LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
mHttpPolicy, mHttpPriority, url,
postData, mHttpOptions, mHttpHeaders, handler);
LLCore::HttpHandle handle = gAgent.requestPostCapibility("UpdateAvatarAppearance", url, postData, handler);
if (handle == LLCORE_HTTP_HANDLE_INVALID)
{
delete handler;
LLCore::HttpStatus status = mHttpRequest->getStatus();
LL_WARNS("Avatar") << "Appearance request post failed Reason " << status.toTerseString()
<< " \"" << status.toString() << "\"" << LL_ENDL;
}
}
@ -3486,14 +3481,6 @@ bool LLAppearanceMgr::testCOFRequestVersion() const
return true;
}
bool LLAppearanceMgr::onIdle()
{
if (!LLAppearanceMgr::mActive)
return true;
mHttpRequest->update(0L);
return false;
}
std::string LLAppearanceMgr::getAppearanceServiceURL() const
{
if (gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride").empty())
@ -3766,21 +3753,8 @@ LLAppearanceMgr::LLAppearanceMgr():
mOutfitLocked(false),
mInFlightCounter(0),
mInFlightTimer(),
mIsInUpdateAppearanceFromCOF(false),
//mAppearanceResponder(new RequestAgentUpdateAppearanceResponder),
mHttpRequest(),
mHttpHeaders(),
mHttpOptions(),
mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID),
mHttpPriority(0)
mIsInUpdateAppearanceFromCOF(false)
{
LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp());
mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest());
mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders(), false);
mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions(), false);
mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_AGENT);
LLOutfitObserver& outfit_observer = LLOutfitObserver::instance();
// unlock outfit on save operation completed
outfit_observer.addCOFSavedCallback(boost::bind(
@ -3790,7 +3764,6 @@ LLAppearanceMgr::LLAppearanceMgr():
"OutfitOperationsTimeout")));
gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, NULL);
doOnIdleRepeating(boost::bind(&LLAppearanceMgr::onIdle, this));
}
LLAppearanceMgr::~LLAppearanceMgr()

View File

@ -226,12 +226,6 @@ public:
private:
std::string mAppearanceServiceURL;
LLCore::HttpRequest::ptr_t mHttpRequest;
LLCore::HttpHeaders::ptr_t mHttpHeaders;
LLCore::HttpOptions::ptr_t mHttpOptions;
LLCore::HttpRequest::policy_t mHttpPolicy;
LLCore::HttpRequest::priority_t mHttpPriority;
protected:
LLAppearanceMgr();
~LLAppearanceMgr();
@ -251,8 +245,6 @@ private:
static void onOutfitRename(const LLSD& notification, const LLSD& response);
bool onIdle();
bool mAttachmentInvLinkEnabled;
bool mOutfitIsDirty;
bool mIsInUpdateAppearanceFromCOF; // to detect recursive calls.