diff options
author | Rider Linden <rider@lindenlab.com> | 2015-09-03 11:10:32 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-09-03 11:10:32 -0700 |
commit | c08072a0508cefc6bfc8c05937e984a095f323ce (patch) | |
tree | 888f05cc81991e0916c800afba167a0cc5da766c /indra/newview/llpanelgroupexperiences.cpp | |
parent | 346f885473282a2826699c1d2c7dd624d60a1bf3 (diff) |
Moved group experiences into experience cache. Use coros and new HTTP libs.
Diffstat (limited to 'indra/newview/llpanelgroupexperiences.cpp')
-rw-r--r-- | indra/newview/llpanelgroupexperiences.cpp | 56 |
1 files changed, 19 insertions, 37 deletions
diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 76b68122fb..067f9eb426 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -37,39 +37,11 @@ #include "llflatlistview.h" #include "llpanelexperiences.h" #include "llsd.h" - +#include "llexperiencecache.h" static LLPanelInjector<LLPanelGroupExperiences> t_panel_group_experiences("panel_group_experiences"); -class LLGroupExperienceResponder : public LLHTTPClient::Responder -{ -public: - LLHandle<LLPanelGroupExperiences> mHandle; - - LLGroupExperienceResponder(LLHandle<LLPanelGroupExperiences> handle) : mHandle(handle) { } - -protected: - /*virtual*/ void httpSuccess() - { - if (mHandle.isDead()) - { - return; - } - - LLPanelGroupExperiences* panel = mHandle.get(); - if (panel) - { - panel->setExperienceList(getContent().get("experience_ids")); - } - } - - /*virtual*/ void httpFailure() - { - LL_WARNS() << "experience responder failed [status:" << getStatus() << "]: " << getContent() << LL_ENDL; - } -}; - LLPanelGroupExperiences::LLPanelGroupExperiences() : LLPanelGroupTab(), mExperiencesList(NULL) { @@ -101,14 +73,8 @@ void LLPanelGroupExperiences::activate() return; } - // search for experiences owned by the current group - std::string url = gAgent.getRegion()->getCapability("GroupExperiences"); - if (!url.empty()) - { - url += "?" + getGroupID().asString(); - - LLHTTPClient::get(url, new LLGroupExperienceResponder(getDerivedHandle<LLPanelGroupExperiences>())); - } + LLExperienceCache::getInstance()->getGroupExperiences(getGroupID(), + boost::bind(&LLPanelGroupExperiences::groupExperiencesResults, getDerivedHandle<LLPanelGroupExperiences>(), _1)); } void LLPanelGroupExperiences::setGroupID(const LLUUID& id) @@ -141,3 +107,19 @@ void LLPanelGroupExperiences::setExperienceList(const LLSD& experiences) mExperiencesList->addItem(item, public_key); } } + +/*static*/ +void LLPanelGroupExperiences::groupExperiencesResults(LLHandle<LLPanelGroupExperiences> handle, const LLSD &experiences) +{ + if (handle.isDead()) + { + return; + } + + LLPanelGroupExperiences* panel = handle.get(); + if (panel) + { + panel->setExperienceList(experiences); + } + +} |