From ab0c9c6754836cb26a520d0a9b2d7bbdd13a5f32 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Fri, 22 Jan 2010 22:16:57 +0200 Subject: Fixed normal bugs EXT-4450 ([BSI] call buttons enabled when voice is disabled) and EXT-4313 (Should not be able to start a call when voice is disabled). Call buttons state now reacts on voice changes in time. - Added voiceWorking() method to LLVoiceClient to determine real availability of voice, because voiceEnabled() doesn't take into account possible errors. Perhaps there is no need in two methods- some investigation will be made and depending on its results they may become one non-static method. voiceWorking() uses state of voice client(mState) to determine voice availability. Also some states which are not currently counted by voiceWorking() as valid may be added if testing reveals problems. - To enable/disable call buttons in time, LLVoiceClientStatusObserver is used. Its trigger uses states from its enum only to skip updating button in some states(to avoid button blinking), but to determine button state LLVoiceClient's voiceWorking() is used. --HG-- branch : product-engine --- indra/newview/llpanelavatar.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 85e95ca1d6..564c80a492 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -165,6 +165,8 @@ BOOL LLPanelAvatarNotes::postBuild() resetControls(); resetData(); + gVoiceClient->addObserver((LLVoiceClientStatusObserver*)this); + return TRUE; } @@ -337,6 +339,8 @@ LLPanelAvatarNotes::~LLPanelAvatarNotes() if(getAvatarId().notNull()) { LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); + if(LLVoiceClient::getInstance()) + LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); } } @@ -346,6 +350,17 @@ void LLPanelAvatarNotes::changed(U32 mask) childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); } +// virtual +void LLPanelAvatarNotes::onChange(EStatusType status, const std::string &channelURI, bool proximal) +{ + if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) + { + return; + } + + childSetEnabled("call", LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()); +} + void LLPanelAvatarNotes::setAvatarId(const LLUUID& id) { if(id.notNull()) @@ -437,7 +452,6 @@ void LLPanelProfileTab::updateButtons() bool enable_map_btn = is_avatar_online && gAgent.isGodlike() || is_agent_mappable(getAvatarId()); childSetEnabled("show_on_map_btn", enable_map_btn); - childSetEnabled("call", LLAvatarActions::canCall(getAvatarId())); } ////////////////////////////////////////////////////////////////////////// @@ -485,6 +499,8 @@ BOOL LLPanelAvatarProfile::postBuild() pic = getChild("real_world_pic"); pic->setFallbackImageName("default_profile_picture.j2c"); + gVoiceClient->addObserver((LLVoiceClientStatusObserver*)this); + resetControls(); resetData(); @@ -757,6 +773,8 @@ LLPanelAvatarProfile::~LLPanelAvatarProfile() if(getAvatarId().notNull()) { LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); + if(LLVoiceClient::getInstance()) + LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); } } @@ -766,6 +784,17 @@ void LLPanelAvatarProfile::changed(U32 mask) childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId())); } +// virtual +void LLPanelAvatarProfile::onChange(EStatusType status, const std::string &channelURI, bool proximal) +{ + if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) + { + return; + } + + childSetEnabled("call", LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()); +} + void LLPanelAvatarProfile::setAvatarId(const LLUUID& id) { if(id.notNull()) -- cgit v1.2.3 From 149c56ae429b0dc8ebf349027fe855066b3447f7 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 25 Jan 2010 13:11:19 +0200 Subject: Related to normal bug EXT-3880 ( [BSI] functionality loss - online status in profile) -- removed logic to process online status (LLPanelAvatarProfile::fillOnlineStatus) for non-existent view (name="online_status") on profile page --HG-- branch : product-engine --- indra/newview/llpanelavatar.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 564c80a492..fe5b20813a 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -584,8 +584,6 @@ void LLPanelAvatarProfile::processProfileProperties(const LLAvatarData* avatar_d fillPartnerData(avatar_data); - fillOnlineStatus(avatar_data); - fillAccountStatus(avatar_data); } @@ -653,21 +651,6 @@ void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) } } -void LLPanelAvatarProfile::fillOnlineStatus(const LLAvatarData* avatar_data) -{ - bool online = avatar_data->flags & AVATAR_ONLINE; - if(LLAvatarActions::isFriend(avatar_data->avatar_id)) - { - // Online status NO could be because they are hidden - // If they are a friend, we may know the truth! - online = LLAvatarTracker::instance().isBuddyOnline(avatar_data->avatar_id); - } - childSetValue("online_status", online ? - "Online" : "Offline"); - childSetColor("online_status", online ? - LLColor4::green : LLColor4::red); -} - void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data) { LLStringUtil::format_map_t args; -- cgit v1.2.3