Partially fixed major bug EXT-4112 ([BSI] Number of groups not limited to 25).

Viewer now disallows joining or creating groups if the limit reached.
A server-side fix is also needed.

--HG--
branch : product-engine
meow-7.2.2
Vadim Savchuk 2010-01-12 20:01:10 +02:00
parent 628b892a66
commit 1f5e82e140
6 changed files with 30 additions and 9 deletions

View File

@ -5157,6 +5157,11 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
return FALSE;
}
BOOL LLAgent::canJoinGroups() const
{
return mGroups.count() < MAX_AGENT_GROUPS;
}
LLQuaternion LLAgent::getHeadRotation()
{
if (mAvatarObject.isNull() || !mAvatarObject->mPelvisp || !mAvatarObject->mHeadp)

View File

@ -972,6 +972,7 @@ public:
BOOL setGroupContribution(const LLUUID& group_id, S32 contribution);
BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile);
const std::string &getGroupName() const { return mGroupName; }
BOOL canJoinGroups() const;
private:
std::string mGroupName;
LLUUID mGroupID;

View File

@ -247,14 +247,7 @@ void LLPanelGroups::enableButtons()
childDisable("IM");
childDisable("Leave");
}
if(gAgent.mGroups.count() < MAX_AGENT_GROUPS)
{
childEnable("Create");
}
else
{
childDisable("Create");
}
childSetEnabled("Create", gAgent.canJoinGroups());
}

View File

@ -146,6 +146,12 @@ void LLGroupActions::startCall(const LLUUID& group_id)
// static
void LLGroupActions::join(const LLUUID& group_id)
{
if (!gAgent.canJoinGroups())
{
LLNotificationsUtil::add("JoinedTooManyGroups");
return;
}
LLGroupMgrGroupData* gdatap =
LLGroupMgr::getInstance()->getGroupData(group_id);

View File

@ -35,6 +35,7 @@
// libs
#include "llfloaterreg.h"
#include "llmenugl.h"
#include "llnotificationsutil.h"
#include "llfiltereditor.h"
#include "lltabcontainer.h"
#include "lluictrlfactory.h"
@ -750,7 +751,6 @@ void LLPanelPeople::updateButtons()
LLPanel* groups_panel = mTabContainer->getCurrentPanel();
groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected
groups_panel->childSetEnabled("plus_btn", item_selected);
groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull());
}
else
@ -1138,6 +1138,12 @@ void LLPanelPeople::onAvatarPicked(
void LLPanelPeople::onGroupPlusButtonClicked()
{
if (!gAgent.canJoinGroups())
{
LLNotificationsUtil::add("JoinedTooManyGroups");
return;
}
LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get();
if (!plus_menu)
return;

View File

@ -2915,6 +2915,16 @@ You have reached your maximum number of groups. Please leave another group befor
yestext="Join"/>
</notification>
<notification
icon="alert.tga"
name="JoinedTooManyGroups"
type="alert">
You have reached your maximum number of groups. Please leave some group before joining or creating a new one.
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification
icon="alert.tga"
name="KickUser"