From 5574363f0d2b6316e7628358357b329b78b6e409 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Fri, 8 Nov 2024 22:28:45 +0800 Subject: Nearby session being first is a non default option which can be set on the leftmost drop-down menu of the conversations floater. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llconversationmodel.cpp | 5 ++++- indra/newview/llfloaterimcontainer.cpp | 8 ++++++++ .../newview/skins/default/xui/en/menu_participant_view.xml | 13 +++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cd82f6122d..42d4e7bb7f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -46,6 +46,17 @@ Value 1 + IMNearbySessionFirst + + Comment + Put nearby session always first(last). + Persist + 1 + Type + Boolean + Value + 0 + IMShowTime Comment diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index bd29dba6bc..0c939add95 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -726,8 +726,11 @@ bool LLConversationSort::operator()(const LLConversationItem* const& a, const LL { if ((type_a == LLConversationItem::CONV_SESSION_NEARBY) || (type_b == LLConversationItem::CONV_SESSION_NEARBY)) { + if (gSavedSettings.getBOOL("IMNearbySessionFirst")) + return (type_b != LLConversationItem::CONV_SESSION_NEARBY); + else // If one is the nearby session, put nearby session *always* last - return (!(type_b == LLConversationItem::CONV_SESSION_NEARBY)); + return (type_b == LLConversationItem::CONV_SESSION_NEARBY); } else if (sort_order == LLConversationFilter::SO_SESSION_TYPE) { diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index abf15ea9cf..3714be2ceb 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1051,6 +1051,10 @@ void LLFloaterIMContainer::onCustomAction(const LLSD& userdata) { setSortOrderParticipants(LLConversationFilter::SO_DISTANCE); } + if ("put_nearby_session_first" == command) + { + gSavedSettings.setBOOL("IMNearbySessionFirst", !gSavedSettings.getBOOL("IMNearbySessionFirst")); + } if ("chat_preferences" == command) { LLFloaterPreference * floater_prefp = LLFloaterReg::showTypedInstance("preferences"); @@ -1101,6 +1105,10 @@ bool LLFloaterIMContainer::isActionChecked(const LLSD& userdata) { return (order.getSortOrderParticipants() == LLConversationFilter::SO_DISTANCE); } + if ("put_nearby_session_first" == command) + { + return gSavedSettings.getBOOL("IMNearbySessionFirst"); + } if ("Translating.Enabled" == command) { return gSavedPerAccountSettings.getBOOL("TranslatingEnabled"); diff --git a/indra/newview/skins/default/xui/en/menu_participant_view.xml b/indra/newview/skins/default/xui/en/menu_participant_view.xml index 7591e6e02f..91c9a378f0 100644 --- a/indra/newview/skins/default/xui/en/menu_participant_view.xml +++ b/indra/newview/skins/default/xui/en/menu_participant_view.xml @@ -59,6 +59,19 @@ function="IMFloaterContainer.Check" parameter="sort_participants_by_recent" /> + + + + +