Skip to content
Snippets Groups Projects
Commit d4a799a1 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-15312 Online status

parent 2ed40188
No related branches found
No related tags found
No related merge requests found
...@@ -946,12 +946,13 @@ void LLPanelProfileSecondLife::resetData() ...@@ -946,12 +946,13 @@ void LLPanelProfileSecondLife::resetData()
void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data) void LLPanelProfileSecondLife::processProfileProperties(const LLAvatarData* avatar_data)
{ {
LLUUID avatar_id = getAvatarId(); 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. // 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 // 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. // 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); fillCommonData(avatar_data);
...@@ -1141,6 +1142,10 @@ void LLPanelProfileSecondLife::fillRightsData() ...@@ -1141,6 +1142,10 @@ void LLPanelProfileSecondLife::fillRightsData()
} }
childSetVisible("permissions_panel", NULL != relation); 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) void LLPanelProfileSecondLife::onImageLoaded(BOOL success, LLViewerFetchedTexture *imagep)
...@@ -1188,10 +1193,7 @@ void LLPanelProfileSecondLife::onImageLoaded(BOOL success, ...@@ -1188,10 +1193,7 @@ void LLPanelProfileSecondLife::onImageLoaded(BOOL success,
// virtual, called by LLAvatarTracker // virtual, called by LLAvatarTracker
void LLPanelProfileSecondLife::changed(U32 mask) void LLPanelProfileSecondLife::changed(U32 mask)
{ {
if (mask & LLFriendObserver::ONLINE) updateOnlineStatus();
{
updateOnlineStatus();
}
if (mask != LLFriendObserver::ONLINE) if (mask != LLFriendObserver::ONLINE)
{ {
fillRightsData(); fillRightsData();
...@@ -1227,35 +1229,32 @@ void LLPanelProfileSecondLife::setAvatarId(const LLUUID& avatar_id) ...@@ -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 // method was disabled according to EXT-2022. Re-enabled & improved according to EXT-3880
void LLPanelProfileSecondLife::updateOnlineStatus() 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()); const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
bool online = relationship->isOnline(); if (relationship != NULL)
processOnlineStatus(online); {
// 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() void LLPanelProfileSecondLife::setLoaded()
......
...@@ -147,8 +147,6 @@ class LLPanelProfileSecondLife ...@@ -147,8 +147,6 @@ class LLPanelProfileSecondLife
BOOL final, BOOL final,
void* userdata); void* userdata);
bool isGrantedToSeeOnlineStatus();
/** /**
* Displays avatar's online status if possible. * Displays avatar's online status if possible.
* *
...@@ -162,7 +160,7 @@ class LLPanelProfileSecondLife ...@@ -162,7 +160,7 @@ class LLPanelProfileSecondLife
* - Else: Offline * - Else: Offline
*/ */
void updateOnlineStatus(); void updateOnlineStatus();
void processOnlineStatus(bool online); void processOnlineStatus(bool show_online, bool online);
private: private:
/*virtual*/ void setLoaded(); /*virtual*/ void setLoaded();
......
indra/newview/skins/default/textures/icons/Profile_Friend_Offline.png

208 B

indra/newview/skins/default/textures/icons/Profile_Friend_Online.png

189 B

...@@ -510,6 +510,8 @@ with the same filename but different name ...@@ -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_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" 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_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_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_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"/> <texture name="Profile_Perm_Objects_Disabled" file_name="icons/Profile_Perm_Objects_Disabled.png" preload="true"/>
......
...@@ -123,10 +123,11 @@ Account: [ACCTTYPE] ...@@ -123,10 +123,11 @@ Account: [ACCTTYPE]
top_pad="0" top_pad="0"
left_delta="0" left_delta="0"
right="-1" right="-1"
height="64" height="80"
follows="left|top|right" follows="left|top|right"
layout="topleft" layout="topleft"
animate="false" animate="false"
border_size="0"
orientation="vertical"> orientation="vertical">
<layout_panel <layout_panel
name="partner_layout" name="partner_layout"
...@@ -150,18 +151,105 @@ Account: [ACCTTYPE] ...@@ -150,18 +151,105 @@ Account: [ACCTTYPE]
use_ellipses="true" use_ellipses="true"
visible="true"/> visible="true"/>
</layout_panel> </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 <layout_panel
name="account_layout" name="account_layout"
follows="all" follows="all"
layout="topleft" layout="topleft"
height="48" height="33"
auto_resize="false" auto_resize="false"
user_resize="false"> user_resize="false">
<text <text
name="account_info" name="account_info"
value="Account: (loading...)" value="Account: (loading...)"
top="15" top="0"
left="0" left="0"
right="-1" right="-1"
height="16" height="16"
...@@ -207,7 +295,7 @@ Account: [ACCTTYPE] ...@@ -207,7 +295,7 @@ Account: [ACCTTYPE]
user_resize="false"> user_resize="false">
<icon <icon
tool_tip="Can see online status" tool_tip="Friend can see my online status"
mouse_opaque="true" mouse_opaque="true"
name="can_see_online" name="can_see_online"
image_name="Profile_Perm_Online_Enabled" image_name="Profile_Perm_Online_Enabled"
...@@ -220,7 +308,7 @@ Account: [ACCTTYPE] ...@@ -220,7 +308,7 @@ Account: [ACCTTYPE]
left_pad="2" /> left_pad="2" />
<icon <icon
tool_tip="Can not see online status" tool_tip="Friend can not see my online status"
mouse_opaque="true" mouse_opaque="true"
name="cant_see_online" name="cant_see_online"
image_name="Profile_Perm_Online_Disabled" image_name="Profile_Perm_Online_Disabled"
...@@ -233,7 +321,7 @@ Account: [ACCTTYPE] ...@@ -233,7 +321,7 @@ Account: [ACCTTYPE]
left_pad="2" /> left_pad="2" />
<icon <icon
tool_tip="Can see on map" tool_tip="Friend can see me on map"
mouse_opaque="true" mouse_opaque="true"
name="can_see_on_map" name="can_see_on_map"
image_name="Profile_Perm_Find_Enabled" image_name="Profile_Perm_Find_Enabled"
...@@ -246,7 +334,7 @@ Account: [ACCTTYPE] ...@@ -246,7 +334,7 @@ Account: [ACCTTYPE]
left_pad="2" /> left_pad="2" />
<icon <icon
tool_tip="Can not see on map" tool_tip="Friend can not see me on map"
mouse_opaque="true" mouse_opaque="true"
name="cant_see_on_map" name="cant_see_on_map"
image_name="Profile_Perm_Find_Disabled" image_name="Profile_Perm_Find_Disabled"
...@@ -259,7 +347,7 @@ Account: [ACCTTYPE] ...@@ -259,7 +347,7 @@ Account: [ACCTTYPE]
left_pad="2" /> left_pad="2" />
<icon <icon
tool_tip="Can edit my objects" tool_tip="Friend can edit my objects"
mouse_opaque="true" mouse_opaque="true"
name="can_edit_objects" name="can_edit_objects"
image_name="Profile_Perm_Objects_Enabled" image_name="Profile_Perm_Objects_Enabled"
...@@ -272,7 +360,7 @@ Account: [ACCTTYPE] ...@@ -272,7 +360,7 @@ Account: [ACCTTYPE]
left_pad="2" /> left_pad="2" />
<icon <icon
tool_tip="Can not edit my objects" tool_tip="Friend can not edit my objects"
mouse_opaque="true" mouse_opaque="true"
name="cant_edit_objects" name="cant_edit_objects"
image_name="Profile_Perm_Objects_Disabled" image_name="Profile_Perm_Objects_Disabled"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment