diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-05-27 17:55:04 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-05-27 17:55:04 +0300 |
commit | d4a799a1a8ce11a808c97d73c03f16d3b3e41597 (patch) | |
tree | 2d7537e058e4e65ffb1222bbfab0eefb3f9182b0 | |
parent | 2ed401882e5ee28415c2ec70e6391855c006769f (diff) |
SL-15312 Online status
-rw-r--r-- | indra/newview/llpanelprofile.cpp | 55 | ||||
-rw-r--r-- | indra/newview/llpanelprofile.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Profile_Friend_Offline.png | bin | 0 -> 208 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/icons/Profile_Friend_Online.png | bin | 0 -> 189 bytes | |||
-rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile_secondlife.xml | 108 |
6 files changed, 128 insertions, 41 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 38308f2498..8a07315035 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -946,12 +946,13 @@ void LLPanelProfileSecondLife::resetData() void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data) { LLUUID avatar_id = getAvatarId(); - if (!LLAvatarActions::isFriend(avatar_id) && !getSelfProfile()) + const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); + if (relationship != NULL && !getSelfProfile()) { // subscribe observer to get online status. Request will be sent by LLPanelProfileSecondLife itself. // do not subscribe for friend avatar because online status can be wrong overridden // via LLAvatarData::flags if Preferences: "Only Friends & Groups can see when I am online" is set. - processOnlineStatus(avatar_data->flags & AVATAR_ONLINE); + processOnlineStatus(relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS), avatar_data->flags & AVATAR_ONLINE); } fillCommonData(avatar_data); @@ -1141,6 +1142,10 @@ void LLPanelProfileSecondLife::fillRightsData() } childSetVisible("permissions_panel", NULL != relation); + childSetVisible("spacer_layout", NULL == relation); + childSetVisible("frind_layout", NULL != relation); + childSetVisible("online_layout", false); + childSetVisible("offline_layout", false); } void LLPanelProfileSecondLife::onImageLoaded(BOOL success, LLViewerFetchedTexture *imagep) @@ -1188,10 +1193,7 @@ void LLPanelProfileSecondLife::onImageLoaded(BOOL success, // virtual, called by LLAvatarTracker void LLPanelProfileSecondLife::changed(U32 mask) { - if (mask & LLFriendObserver::ONLINE) - { - updateOnlineStatus(); - } + updateOnlineStatus(); if (mask != LLFriendObserver::ONLINE) { fillRightsData(); @@ -1227,35 +1229,32 @@ void LLPanelProfileSecondLife::setAvatarId(const LLUUID& avatar_id) } } -bool LLPanelProfileSecondLife::isGrantedToSeeOnlineStatus() -{ - // set text box visible to show online status for non-friends who has not set in Preferences - // "Only Friends & Groups can see when I am online" - if (!LLAvatarActions::isFriend(getAvatarId())) - { - return true; - } - - // *NOTE: GRANT_ONLINE_STATUS is always set to false while changing any other status. - // When avatar disallow me to see her online status processOfflineNotification Message is received by the viewer - // see comments for ChangeUserRights template message. EXT-453. - // If GRANT_ONLINE_STATUS flag is changed it will be applied when viewer restarts. EXT-3880 - const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - return relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS); -} - // method was disabled according to EXT-2022. Re-enabled & improved according to EXT-3880 void LLPanelProfileSecondLife::updateOnlineStatus() { - if (!LLAvatarActions::isFriend(getAvatarId())) return; - // For friend let check if he allowed me to see his status const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - bool online = relationship->isOnline(); - processOnlineStatus(online); + if (relationship != NULL) + { + // For friend let check if he allowed me to see his status + bool online = relationship->isOnline(); + bool perm_granted = relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS); + processOnlineStatus(perm_granted, online); + } + else + { + childSetVisible("spacer_layout", true); + childSetVisible("frind_layout", false); + childSetVisible("online_layout", false); + childSetVisible("offline_layout", false); + } } -void LLPanelProfileSecondLife::processOnlineStatus(bool online) +void LLPanelProfileSecondLife::processOnlineStatus(bool show_online, bool online) { + childSetVisible("spacer_layout", false); + childSetVisible("frind_layout", true); + childSetVisible("online_layout", online && show_online); + childSetVisible("offline_layout", !online && show_online); } void LLPanelProfileSecondLife::setLoaded() diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index b53a892ba6..cf3b6c0eb1 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -147,8 +147,6 @@ protected: BOOL final, void* userdata); - bool isGrantedToSeeOnlineStatus(); - /** * Displays avatar's online status if possible. * @@ -162,7 +160,7 @@ protected: * - Else: Offline */ void updateOnlineStatus(); - void processOnlineStatus(bool online); + void processOnlineStatus(bool show_online, bool online); private: /*virtual*/ void setLoaded(); diff --git a/indra/newview/skins/default/textures/icons/Profile_Friend_Offline.png b/indra/newview/skins/default/textures/icons/Profile_Friend_Offline.png Binary files differnew file mode 100644 index 0000000000..aeba6b70f7 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Profile_Friend_Offline.png diff --git a/indra/newview/skins/default/textures/icons/Profile_Friend_Online.png b/indra/newview/skins/default/textures/icons/Profile_Friend_Online.png Binary files differnew file mode 100644 index 0000000000..d668fd8dfa --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Profile_Friend_Online.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 02d48bb0d6..a21099ca9b 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -510,6 +510,8 @@ with the same filename but different name <texture name="Profile_Group_Visibility_Off_Pressed" file_name="icons/profile_group_visibility_eye_off_pressed.png" preload="true"/> <texture name="Profile_Group_Visibility_On" file_name="icons/profile_group_visibility_eye_on.png" preload="true"/> <texture name="Profile_Group_Visibility_On_Pressed" file_name="icons/profile_group_visibility_eye_on_pressed.png" preload="true"/> + <texture name="Profile_Friend_Offline" file_name="icons/Profile_Friend_Offline.png" preload="true"/> + <texture name="Profile_Friend_Online" file_name="icons/Profile_Friend_Online.png" preload="true"/> <texture name="Profile_Perm_Find_Disabled" file_name="icons/Profile_Perm_Find_Disabled.png" preload="true"/> <texture name="Profile_Perm_Find_Enabled" file_name="icons/Profile_Perm_Find_Enabled.png" preload="true"/> <texture name="Profile_Perm_Objects_Disabled" file_name="icons/Profile_Perm_Objects_Disabled.png" preload="true"/> diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index 56cf673e19..853e782de1 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -123,10 +123,11 @@ Account: [ACCTTYPE] top_pad="0" left_delta="0" right="-1" - height="64" + height="80" follows="left|top|right" layout="topleft" animate="false" + border_size="0" orientation="vertical"> <layout_panel name="partner_layout" @@ -150,18 +151,105 @@ Account: [ACCTTYPE] use_ellipses="true" visible="true"/> </layout_panel> - + <layout_panel + name="spacer_layout" + follows="all" + layout="topleft" + height="14" + auto_resize="false" + user_resize="false" + visible="true"> + </layout_panel> + <layout_panel + name="frind_layout" + follows="all" + layout="topleft" + height="16" + auto_resize="false" + user_resize="false" + visible="false"> + <text + name="frind_text" + value="You are friends" + text_color="Green" + top="0" + left="0" + right="-1" + height="16" + follows="left|top|right" + layout="topleft" + translate="false" + visible="true"/> + </layout_panel> + <layout_panel + name="online_layout" + follows="all" + layout="topleft" + height="16" + auto_resize="false" + user_resize="false" + visible="false"> + <icon + name="online_icon" + image_name="Profile_Friend_Online" + layout="topleft" + follows="left|top" + top="0" + left="0" + height="10" + width="10"/> + <text + name="online_text" + value="Online" + top="0" + left="13" + right="-1" + height="16" + follows="left|top|right" + layout="topleft" + translate="false" + visible="true"/> + </layout_panel> + <layout_panel + name="offline_layout" + follows="all" + layout="topleft" + height="16" + auto_resize="false" + user_resize="false" + visible="false"> + <icon + name="offline_icon" + image_name="Profile_Friend_Offline" + layout="topleft" + follows="left|top" + top="0" + left="0" + height="10" + width="10"/> + <text + name="offline_text" + value="Offline" + top="0" + left="13" + right="-1" + height="16" + follows="left|top|right" + layout="topleft" + translate="false" + visible="true"/> + </layout_panel> <layout_panel name="account_layout" follows="all" layout="topleft" - height="48" + height="33" auto_resize="false" user_resize="false"> <text name="account_info" value="Account: (loading...)" - top="15" + top="0" left="0" right="-1" height="16" @@ -207,7 +295,7 @@ Account: [ACCTTYPE] user_resize="false"> <icon - tool_tip="Can see online status" + tool_tip="Friend can see my online status" mouse_opaque="true" name="can_see_online" image_name="Profile_Perm_Online_Enabled" @@ -220,7 +308,7 @@ Account: [ACCTTYPE] left_pad="2" /> <icon - tool_tip="Can not see online status" + tool_tip="Friend can not see my online status" mouse_opaque="true" name="cant_see_online" image_name="Profile_Perm_Online_Disabled" @@ -233,7 +321,7 @@ Account: [ACCTTYPE] left_pad="2" /> <icon - tool_tip="Can see on map" + tool_tip="Friend can see me on map" mouse_opaque="true" name="can_see_on_map" image_name="Profile_Perm_Find_Enabled" @@ -246,7 +334,7 @@ Account: [ACCTTYPE] left_pad="2" /> <icon - tool_tip="Can not see on map" + tool_tip="Friend can not see me on map" mouse_opaque="true" name="cant_see_on_map" image_name="Profile_Perm_Find_Disabled" @@ -259,7 +347,7 @@ Account: [ACCTTYPE] left_pad="2" /> <icon - tool_tip="Can edit my objects" + tool_tip="Friend can edit my objects" mouse_opaque="true" name="can_edit_objects" image_name="Profile_Perm_Objects_Enabled" @@ -272,7 +360,7 @@ Account: [ACCTTYPE] left_pad="2" /> <icon - tool_tip="Can not edit my objects" + tool_tip="Friend can not edit my objects" mouse_opaque="true" name="cant_edit_objects" image_name="Profile_Perm_Objects_Disabled" |