summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofileview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelprofileview.cpp')
-rw-r--r--indra/newview/llpanelprofileview.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
index 18184a6476..0762bbeb87 100644
--- a/indra/newview/llpanelprofileview.cpp
+++ b/indra/newview/llpanelprofileview.cpp
@@ -31,12 +31,16 @@
*/
#include "llviewerprecompiledheaders.h"
+
+#include "lluserrelations.h"
+
#include "llpanelprofileview.h"
+#include "llcallingcard.h"
#include "llpanelavatar.h"
#include "llpanelpicks.h"
-#include "llsidetraypanelcontainer.h"
#include "llpanelprofile.h"
+#include "llsidetraypanelcontainer.h"
static LLRegisterPanelClassWrapper<LLPanelProfileView> t_panel_target_profile("panel_profile_view");
@@ -45,6 +49,7 @@ static const std::string PANEL_PROFILE = "panel_profile";
LLPanelProfileView::LLPanelProfileView()
: LLPanelProfile()
+, mStatusText(NULL)
{
}
@@ -65,6 +70,10 @@ void LLPanelProfileView::onOpen(const LLSD& key)
setAvatarId(id);
}
+ // status should only show if viewer has permission to view online/offline. EXT-453
+ mStatusText->setVisible(isGrantedToSeeOnlineStatus());
+ updateOnlineStatus();
+
LLPanelProfile::onOpen(key);
}
@@ -78,6 +87,8 @@ BOOL LLPanelProfileView::postBuild()
getTabContainer()[PANEL_PROFILE]->childSetVisible("online_me_status_text", FALSE);
getTabContainer()[PANEL_PROFILE]->childSetVisible("status_combo", FALSE);
+ mStatusText = getChild<LLTextBox>("status");
+
childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL);
return TRUE;
@@ -94,3 +105,32 @@ void LLPanelProfileView::onBackBtnClick()
parent->openPreviousPanel();
}
}
+
+bool LLPanelProfileView::isGrantedToSeeOnlineStatus()
+{
+ const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
+ if (NULL == relationship)
+ return false;
+
+ // *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.
+// return relationship->isRightGrantedFrom(LLRelationship::GRANT_ONLINE_STATUS);
+ return true;
+}
+
+void LLPanelProfileView::updateOnlineStatus()
+{
+ const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId());
+ if (NULL == relationship)
+ return;
+
+ bool online = relationship->isOnline();
+// std::string statusName();
+
+ std::string status = getString(online ? "status_online" : "status_offline");
+
+ mStatusText->setValue(status);
+}
+
+// EOF