summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgroup.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-05-15 16:17:09 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-05-15 16:17:09 -0400
commit2e144ecbb2cc7676cfb9f5ab46a2f63c8af85d85 (patch)
tree0296876c167d0bec11434394157b4a5b1c0b63a5 /indra/newview/llpanelgroup.cpp
parent1b5f0590ce45ce6e540d266a8902af5839885cfb (diff)
parent33ad8db77584c66496f261a1cfd9aa535462a003 (diff)
Merge branch 'main' into nat/releaseos following Maint X promotion
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"));
}
}
}