summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroupexperiences.cpp
diff options
context:
space:
mode:
authorGlenn Glazer <coyot@lindenlab.com>2016-04-07 12:10:13 -0700
committerGlenn Glazer <coyot@lindenlab.com>2016-04-07 12:10:13 -0700
commit369cefd5b3f2f52ae0dd203fcd45a4618f74b0f3 (patch)
tree941d27a32099abaf71bae8a2865002e2b25a3512 /indra/newview/llpanelgroupexperiences.cpp
parent0494a502aafac73800352dc26c4eb3a27b02a8ce (diff)
parent18928ea6c6f2830a0d45ec412c915eceff1b76b0 (diff)
pull from viewer-release
Diffstat (limited to 'indra/newview/llpanelgroupexperiences.cpp')
-rw-r--r--indra/newview/llpanelgroupexperiences.cpp57
1 files changed, 19 insertions, 38 deletions
diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp
index 76b68122fb..a88a55ab22 100644
--- a/indra/newview/llpanelgroupexperiences.cpp
+++ b/indra/newview/llpanelgroupexperiences.cpp
@@ -31,45 +31,16 @@
#include "lluictrlfactory.h"
#include "roles_constants.h"
-#include "llhttpclient.h"
#include "llagent.h"
#include "llviewerregion.h"
#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 +72,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::instance().getGroupExperiences(getGroupID(),
+ boost::bind(&LLPanelGroupExperiences::groupExperiencesResults, getDerivedHandle<LLPanelGroupExperiences>(), _1));
}
void LLPanelGroupExperiences::setGroupID(const LLUUID& id)
@@ -141,3 +106,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);
+ }
+
+}