Satisfy SV-2101: Add LiruOnlineNotificationBehavior to allow configuration of behavior when FriendOnline notification is clicked

This commit is contained in:
Lirusaito
2016-06-28 07:56:02 -04:00
parent b8ca422e71
commit e11b70415d
2 changed files with 25 additions and 13 deletions

View File

@@ -796,17 +796,6 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruResizeRootWithScreen</key>
<map>
<key>Comment</key>
<string>When false, the ui view won't resize when the screen does (floaters won't move around without user interaction, but they also might be restricted from moving everywhere).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruLegacyScrollToEnd</key>
<map>
<key>Comment</key>
@@ -978,6 +967,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruOnlineNotificationBehavior</key>
<map>
<key>Comment</key>
<string>Determines if Friend is Online notifications will do anything when clicked. (0 does nothing, 1 starts an IM (default), 2 opens profile.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruRegionRestartMinimized</key>
<map>
<key>Comment</key>
@@ -991,6 +991,17 @@
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>LiruResizeRootWithScreen</key>
<map>
<key>Comment</key>
<string>When false, the ui view won't resize when the screen does (floaters won't move around without user interaction, but they also might be restricted from moving everywhere).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>LiruScriptErrorsStealFocus</key>
<map>
<key>Comment</key>

View File

@@ -749,13 +749,14 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id,
// Popup a notify box with online status of this agent
LLNotificationPtr notification;
if (online)
static const LLCachedControl<S32> behavior(gSavedSettings, "LiruOnlineNotificationBehavior", 1);
if (online && behavior)
{
notification =
LLNotifications::instance().add("FriendOnlineOffline",
args,
payload,
boost::bind(&LLAvatarActions::startIM, agent_id));
behavior == 1 ? boost::bind(&LLAvatarActions::startIM, agent_id) : boost::bind(LLAvatarActions::showProfile, agent_id, false));
}
else
{