From efc9422d1b87f2ccf191acde107652102ebf95d0 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 29 May 2014 03:24:13 +0300 Subject: MAINT-3351 FIXED Misleading failure message when user is successfully removed from a group's Owners role --- indra/newview/llgroupmgr.cpp | 5 +++++ indra/newview/llgroupmgr.h | 2 ++ indra/newview/llpanelgroup.cpp | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 83ce2b0483..081f47df41 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -611,6 +611,11 @@ void LLGroupMgrGroupData::recalcAgentPowers(const LLUUID& agent_id) } } +bool LLGroupMgrGroupData::isSingleMemberNotOwner() +{ + return mMembers.size() == 1 && !mMembers.begin()->second->isOwner(); +} + bool packRoleUpdateMessageBlock(LLMessageSystem* msg, const LLUUID& group_id, const LLUUID& role_id, diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 9e1c1eec90..2b4c9700be 100755 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -254,6 +254,8 @@ public: bool isRoleMemberDataComplete() { return mRoleMemberDataComplete; } bool isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; } + bool isSingleMemberNotOwner(); + F32 getAccessTime() const { return mAccessTime; } void setAccessed(); diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index bf332d1ca7..f4aab6bd4e 100755 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -49,6 +49,7 @@ #include "llpanelgroupnotices.h" #include "llpanelgroupgeneral.h" +#include "llpanelgrouproles.h" #include "llaccordionctrltab.h" #include "llaccordionctrl.h" @@ -275,6 +276,7 @@ void LLPanelGroup::onBtnApply(void* user_data) { LLPanelGroup* self = static_cast(user_data); self->apply(); + self->refreshData(); } void LLPanelGroup::onBtnGroupCallClicked(void* user_data) @@ -497,6 +499,22 @@ bool LLPanelGroup::apply(LLPanelGroupTab* tab) { //we skip refreshing group after ew manually apply changes since its very annoying //for those who are editing group + + LLPanelGroupRoles * roles_tab = dynamic_cast(tab); + if (roles_tab) + { + LLGroupMgr* gmgrp = LLGroupMgr::getInstance(); + LLGroupMgrGroupData* gdatap = gmgrp->getGroupData(roles_tab->getGroupID()); + + // allow refresh only for one specific case: + // there is only one member in group and it is not owner + // it's a wrong situation and need refresh panels from server + if (gdatap && gdatap->isSingleMemberNotOwner()) + { + return true; + } + } + mSkipRefresh = TRUE; return true; } -- cgit v1.2.3