summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-11-08 22:32:15 +0800
committerErik Kundiman <erik@megapahit.org>2024-11-08 22:32:15 +0800
commit292932eadebff918d2ead665d14ff0ef48695e18 (patch)
tree2330254a3be8b6dc0f06f74ab2c58586bb946f94
parentf90dce5a4dd6f2c227ca58604047d7ba3405f443 (diff)
parent5574363f0d2b6316e7628358357b329b78b6e409 (diff)
Merge branch 'main' into maint-c
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llconversationmodel.cpp5
-rw-r--r--indra/newview/llfloaterimcontainer.cpp8
-rw-r--r--indra/newview/skins/default/xui/en/menu_participant_view.xml13
4 files changed, 36 insertions, 1 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 8b2d6dfd37..4f191960ed 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -46,6 +46,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>IMNearbySessionFirst</key>
+ <map>
+ <key>Comment</key>
+ <string>Put nearby session always first(last).</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>IMShowTime</key>
<map>
<key>Comment</key>
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 ed24a8af57..f1d612ba94 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -1059,6 +1059,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<LLFloaterPreference>("preferences");
@@ -1109,6 +1113,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
@@ -61,6 +61,19 @@
</menu_item_check>
<menu_item_separator
layout="topleft" />
+ <menu_item_check
+ label="Put nearby session always first"
+ layout="topleft"
+ name="put_nearby_session_first">
+ <on_click
+ function="IMFloaterContainer.Action"
+ parameter="put_nearby_session_first" />
+ <on_check
+ function="IMFloaterContainer.Check"
+ parameter="put_nearby_session_first" />
+ </menu_item_check>
+ <menu_item_separator
+ layout="topleft" />
<menu_item_call
label="Chat preferences..."
name="chat_preferences">