diff options
| author | Steven Bennetts <steve@lindenlab.com> | 2009-09-02 02:59:07 +0000 |
|---|---|---|
| committer | Steven Bennetts <steve@lindenlab.com> | 2009-09-02 02:59:07 +0000 |
| commit | 5612f13dc8693d89cb5c89f8b1a15115742fba8d (patch) | |
| tree | 51e9fb2dcf50ad701deee378e6a146aa0ba600a5 /indra/newview/llpanelprofileview.cpp | |
| parent | 1a5cb4fbfb718a6740bdee0442efbb3ae2897b9b (diff) | |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1516 https://svn.aws.productengine.com/secondlife/pe/stable-2@1526 -> viewer-2.0.0-3
* Bugs: EXT-622 EXT-702 EXT-626 EXT-638 EXT-600 EXT-543 EXT-656 EXT-801
* New Dev: EXT-282 EXT-782 EXT-694 EXT-797 EXT-798 EXT-799 EXT-453
Diffstat (limited to 'indra/newview/llpanelprofileview.cpp')
| -rw-r--r-- | indra/newview/llpanelprofileview.cpp | 42 |
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 |
