Skip to content
Snippets Groups Projects
Unverified Commit 0f742298 authored by Maxim Nikolenko's avatar Maxim Nikolenko Committed by GitHub
Browse files

SL-20376 Clarify group membership status and leave-group confirmation dialog

parent ddb2c938
No related branches found
No related tags found
No related merge requests found
......@@ -366,7 +366,16 @@ void LLGroupActions::processLeaveGroupDataResponse(const LLUUID group_id)
args["GROUP"] = gdatap->mName;
LLSD payload;
payload["group_id"] = group_id;
LLNotificationsUtil::add("GroupLeaveConfirmMember", args, payload, onLeaveGroup);
if (gdatap->mMembershipFee > 0)
{
args["COST"] = gdatap->mMembershipFee;
LLNotificationsUtil::add("GroupLeaveConfirmMember", args, payload, onLeaveGroup);
}
else
{
LLNotificationsUtil::add("GroupLeaveConfirmMemberNoFee", args, payload, onLeaveGroup);
}
}
// static
......
......@@ -273,8 +273,15 @@ void LLPanelGroup::onBtnGroupChatClicked(void* user_data)
void LLPanelGroup::onBtnJoin()
{
LL_DEBUGS() << "joining group: " << mID << LL_ENDL;
LLGroupActions::join(mID);
if (LLGroupActions::isInGroup(mID))
{
LLGroupActions::leave(mID);
}
else
{
LL_DEBUGS() << "joining group: " << mID << LL_ENDL;
LLGroupActions::join(mID);
}
}
void LLPanelGroup::changed(LLGroupChange gc)
......@@ -312,12 +319,17 @@ void LLPanelGroup::update(LLGroupChange gc)
LLGroupData agent_gdatap;
bool is_member = gAgent.getGroupData(mID,agent_gdatap) || gAgent.isGodlikeWithoutAdminMenuFakery();
bool join_btn_visible = !is_member && gdatap->mOpenEnrollment;
bool join_btn_visible = is_member || gdatap->mOpenEnrollment;
mButtonJoin->setVisible(join_btn_visible);
mJoinText->setVisible(join_btn_visible);
if(join_btn_visible)
if (is_member)
{
mJoinText->setValue(getString("group_member"));
mButtonJoin->setLabel(getString("leave_txt"));
}
else if(join_btn_visible)
{
LLStringUtil::format_map_t string_args;
std::string fee_buff;
......@@ -332,6 +344,7 @@ void LLPanelGroup::update(LLGroupChange gc)
fee_buff = getString("group_join_free", string_args);
}
mJoinText->setValue(fee_buff);
mButtonJoin->setLabel(getString("join_txt"));
}
}
}
......
......@@ -4399,8 +4399,22 @@ Are you sure you want to return the selected objects to their owners? Transferab
icon="alert.tga"
name="GroupLeaveConfirmMember"
type="alert">
You are currently a member of the group &lt;nolink&gt;[GROUP]&lt;/nolink&gt;.
Leave Group?
Leave the group &apos;&lt;nolink&gt;[GROUP]&lt;/nolink&gt;&apos;?
Currently, the fee to join this &quot;group&quot; is L$ [COST].
<tag>group</tag>
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alert.tga"
name="GroupLeaveConfirmMemberNoFee"
type="alert">
Leave the group &apos;&lt;nolink&gt;[GROUP]&lt;/nolink&gt;&apos;?
There is currently no fee to join this group.
<tag>group</tag>
<tag>confirm</tag>
<usetemplate
......
......@@ -65,7 +65,7 @@ Hover your mouse over the options for more help.
width="168" />
<text
font="SansSerifMedium"
text_color="EmphasisColor"
text_color="white"
type="string"
follows="left|top"
height="16"
......@@ -75,14 +75,14 @@ Hover your mouse over the options for more help.
top_pad="10"
visible="true"
width="190">
Free
No charge to join
</text>
<button
follows="left|top"
left_delta="0"
top_pad="6"
height="23"
label="JOIN NOW!"
label="Join group"
name="btn_join"
visible="true"
width="120" />
......
......@@ -22,10 +22,10 @@ background_visible="true"
name="group_join_btn">
Join (L$[AMOUNT])
</panel.string>
<panel.string
name="group_join_free">
Free
</panel.string>
<panel.string name="group_join_free">No charge to join</panel.string>
<panel.string name="group_member">You are a member</panel.string>
<panel.string name="join_txt">Join group</panel.string>
<panel.string name="leave_txt">Leave</panel.string>
<panel
name="group_info_top"
follows="top|left"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment