summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroup.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-05-15 12:24:16 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-05-15 12:24:16 -0400
commit9463f10b3332d34655006f4ba5127b114ca6e0c3 (patch)
tree2e5e3226fbae28cba66e473edc09ccc9f8bd50cf /indra/newview/llpanelgroup.cpp
parent7137647e90d8c11197513f542f04fb39b483d663 (diff)
parentb1098308428873e927cbf3c956ed0a7f17dc439b (diff)
Merge branch 'release/luau-scripting' into lua-timers after Maint X
Diffstat (limited to 'indra/newview/llpanelgroup.cpp')
-rw-r--r--indra/newview/llpanelgroup.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp
index de35aea35a..6b7680d19d 100644
--- a/indra/newview/llpanelgroup.cpp
+++ b/indra/newview/llpanelgroup.cpp
@@ -134,6 +134,15 @@ void LLPanelGroup::onOpen(const LLSD& key)
if(panel_notices)
panel_notices->refreshNotices();
}
+ if (str_action == "show_notices")
+ {
+ setGroupID(group_id);
+
+ LLAccordionCtrl *tab_ctrl = getChild<LLAccordionCtrl>("groups_accordion");
+ tab_ctrl->collapseAllTabs();
+ getChild<LLAccordionCtrlTab>("group_notices_tab")->setDisplayChildren(true);
+ tab_ctrl->arrange();
+ }
}
@@ -264,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)
@@ -303,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;
@@ -323,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"));
}
}
}