From af7d4d8b27e142e324436e352a0b30f8e69db0bf Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Mon, 24 Nov 2025 20:43:58 +0100 Subject: [PATCH] FIRE-36144 Add confirmation for global online status change I considered using a local variable instead of a debug setting, but in the end I decided not to clutter the header file any further just to satisfy a function that's used once in a blue moon Signed-off-by: PanteraPolnocy --- .../app_settings/settings_per_account.xml | 13 ++++++++++++ indra/newview/llviewercontrol.cpp | 21 ++++++++++++++++++- indra/newview/llviewercontrol.h | 4 ++++ .../skins/default/xui/en/notifications.xml | 13 ++++++++++++ .../skins/default/xui/pl/notifications.xml | 6 ++++++ 5 files changed, 56 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 1641ec6b89..c035318956 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -365,6 +365,19 @@ Value 1 + GlobalOnlineStatusCurrentlyReverting + + Comment + Flag to prevent infinite loop when reverting the setting on cancel + HideFromEditor + 1 + Persist + 0 + Type + Boolean + Value + 0 + InstantMessageLogPath Comment diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index a4af0ccc34..5b5865b6c0 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -896,7 +896,26 @@ void handleUsernameFormatOptionChanged(const LLSD& newvalue) // Global online status toggle void handleGlobalOnlineStatusChanged(const LLSD& newvalue) { - bool visible = newvalue.asBoolean(); + if (!gSavedPerAccountSettings.getBOOL("GlobalOnlineStatusCurrentlyReverting")) + { + bool visible = newvalue.asBoolean(); + LLSD payload; + payload["visible"] = visible; + LLNotificationsUtil::add("ConfirmGlobalOnlineStatusToggle", LLSD(), payload, applyGlobalOnlineStatusChange); + } +} + +void applyGlobalOnlineStatusChange(const LLSD& notification, const LLSD& response) +{ + bool visible = notification["payload"]["visible"].asBoolean(); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) + { + gSavedPerAccountSettings.setBOOL("GlobalOnlineStatusCurrentlyReverting", true); + gSavedPerAccountSettings.setBOOL("GlobalOnlineStatusToggle", !visible); + gSavedPerAccountSettings.setBOOL("GlobalOnlineStatusCurrentlyReverting", false); + return; + } LLAvatarTracker::buddy_map_t all_buddies; LLAvatarTracker::instance().copyBuddyList(all_buddies); diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index e847080e04..6f6a231b67 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -61,4 +61,8 @@ extern LLControlGroup gCrashSettings; // Set after settings loaded extern std::string gLastRunVersion; +// Global online status toggle +void applyGlobalOnlineStatusChange(const LLSD& notification, const LLSD& response); +// + #endif // LL_LLVIEWERCONTROL_H diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f25ce7698f..fa8cd8afae 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -14128,6 +14128,19 @@ the region "[REGION]"? name="okbutton" yestext="OK"/> + +Are you sure you want to change your online status visibility for all friends at once? + +Due to server load, this mass change can take a while to become effective and may cause temporary issues for some friends seeing your online status. + confirm + + Nie można utworzyć kolejnego Miejsca, ponieważ limit ich ilości został osiągnięty. + + Czy na pewno chcesz zmienić widoczność swojego statusu online dla wszystkich znajomych naraz? + +Ze względu na obciążenie serwera taka masowa zmiana może chwilę potrwać i tymczasowo powodować problemy z wyświetlaniem Twojego statusu online u niektórych znajomych. + + Ze względu na obciążenie serwera masowa zmiana widoczności online może zająć trochę czasu. Prosimy o cierpliwość.