From 6f41747bc4d8afcb2b19ac02295575031bcf9021 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 21 Oct 2009 04:58:23 +0000 Subject: Merging revisions 2112-2128 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry * Bugs: EXT-1605 EXT-1506 EXT-1663 EXT-1616 EXT-1599 EXT-1587 * Dev: EXT-748 EXT-1447 * IM Cleanup --- indra/newview/llimfloater.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'indra/newview/llimfloater.cpp') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 452943007d..8f0186ce24 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -83,13 +83,20 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) } } +void LLIMFloater::onFocusLost() +{ + LLIMModel::getInstance()->resetActiveSessionID(); +} + +void LLIMFloater::onFocusReceived() +{ + LLIMModel::getInstance()->setActiveSessionID(mSessionID); +} + // virtual void LLIMFloater::onClose(bool app_quitting) { - LLIMModel::instance().sendLeaveSession(mSessionID, mOtherParticipantUUID); - - //*TODO - move to the IMModel::sendLeaveSession() for the integrity (IB) - gIMMgr->removeSession(mSessionID); + gIMMgr->leaveSession(mSessionID); } /* static */ @@ -114,6 +121,23 @@ void LLIMFloater::newIMCallback(const LLSD& data){ } } +void LLIMFloater::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + + LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); + + if (visible && voice_channel && + voice_channel->getState() == LLVoiceChannel::STATE_CONNECTED) + { + LLFloaterReg::showInstance("voice_call", mSessionID); + } + else + { + LLFloaterReg::hideInstance("voice_call", mSessionID); + } +} + void LLIMFloater::onSendMsg( LLUICtrl* ctrl, void* userdata ) { LLIMFloater* self = (LLIMFloater*) userdata; -- cgit v1.2.3