diff options
author | andreykproductengine <akleshchev@productengine.com> | 2014-06-04 18:38:01 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2014-06-04 18:38:01 +0300 |
commit | f0eb544148456f05bd1c6390542192911df32364 (patch) | |
tree | 1a3322a6c5abe0ef3503841e29108ac044362da0 /indra | |
parent | efc9422d1b87f2ccf191acde107652102ebf95d0 (diff) |
MAINT-3386 FIXED [vwr] Banned Agents list does not show newly-banned residents
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llgroupmgr.cpp | 38 | ||||
-rwxr-xr-x | indra/newview/llgroupmgr.h | 5 | ||||
-rw-r--r-- | indra/newview/llpanelgroupbulkban.cpp | 2 |
3 files changed, 37 insertions, 8 deletions
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 081f47df41..0801568a93 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1866,12 +1866,20 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, class GroupBanDataResponder : public LLHTTPClient::Responder { public: - GroupBanDataResponder() {} + GroupBanDataResponder(const LLUUID& gropup_id, BOOL force_refresh=false); virtual ~GroupBanDataResponder() {} virtual void result(const LLSD& pContent); virtual void errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent); +private: + LLUUID mGroupID; + BOOL mForceRefresh; }; +GroupBanDataResponder::GroupBanDataResponder(const LLUUID& gropup_id, BOOL force_refresh) : + mGroupID(gropup_id), + mForceRefresh(force_refresh) +{} + void GroupBanDataResponder::errorWithContent(U32 pStatus, const std::string& pReason, const LLSD& pContent) { LL_WARNS("GrpMgr") << "Error receiving group member data [status:" @@ -1880,12 +1888,32 @@ void GroupBanDataResponder::errorWithContent(U32 pStatus, const std::string& pRe void GroupBanDataResponder::result(const LLSD& content) { - LLGroupMgr::processGroupBanRequest(content); + if ( content.size()) + { + if (content.has("ban_list")) + { + // group data received + LLGroupMgr::processGroupBanRequest(content); + } + // no group data received, this is either CREATE or DELETE operation + // complete confirmation. Local data may be obsolete. + else if (mForceRefresh) + { + // providing mGroupId and not extracting it from content since it is not + // included into CREATE and DELETE responses + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); + } + } + else + { + LL_WARNS("GrpMgr") << "No group member data received." << LL_ENDL; + return; + } } void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, const LLUUID& group_id, - EBanRequestAction ban_action, /* = BAN_NO_ACTION */ + U32 ban_action, /* = BAN_NO_ACTION */ const std::vector<LLUUID> ban_list) /* = std::vector<LLUUID>() */ { LLViewerRegion* currentRegion = gAgent.getRegion(); @@ -1911,7 +1939,7 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, cap_url += "?group_id=" + group_id.asString(); LLSD body = LLSD::emptyMap(); - body["ban_action"] = ban_action; + body["ban_action"] = (LLSD::Integer)(ban_action & ~BAN_UPDATE); // Add our list of potential banned residents to the list body["ban_ids"] = LLSD::emptyArray(); LLSD ban_entry; @@ -1923,7 +1951,7 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, body["ban_ids"].append(ban_entry); } - LLHTTPClient::ResponderPtr grp_ban_responder = new GroupBanDataResponder(); + LLHTTPClient::ResponderPtr grp_ban_responder = new GroupBanDataResponder(group_id, ban_action & BAN_UPDATE); switch(request_type) { case REQUEST_GET: diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 2b4c9700be..970d6d5a2d 100755 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -356,7 +356,8 @@ public: { BAN_NO_ACTION = 0, BAN_CREATE = 1, - BAN_DELETE = 2 + BAN_DELETE = 2, + BAN_UPDATE = 4 }; public: @@ -395,7 +396,7 @@ public: static void sendGroupBanRequest(EBanRequestType request_type, const LLUUID& group_id, - EBanRequestAction ban_action = BAN_NO_ACTION, + U32 ban_action = BAN_NO_ACTION, const uuid_vec_t ban_list = uuid_vec_t()); static void processGroupBanRequest(const LLSD& content); diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index 5b9dc21f20..0b57233f47 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -136,7 +136,7 @@ void LLPanelGroupBulkBan::submit() return; } - LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE, banned_agent_list); + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE | LLGroupMgr::BAN_UPDATE, banned_agent_list); LLGroupMgr::getInstance()->sendGroupMemberEjects(mImplementation->mGroupID, banned_agent_list); //then close |