From 33af464c441717db855651b70acc4b3636c649a0 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 28 Oct 2009 14:21:36 +0200 Subject: Implemented major sub-task EXT-1904 (New IM floater should handle Session Update) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 24 ++++++++++++++++++++++++ indra/newview/llimfloater.h | 1 + indra/newview/llimview.cpp | 17 ++++++++++++++++- indra/newview/skins/default/xui/en/strings.xml | 2 ++ 4 files changed, 43 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 9e92e2f490..b8b0290b18 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -562,6 +562,30 @@ void LLIMFloater::processIMTyping(const LLIMInfo* im_info, BOOL typing) } } +void LLIMFloater::processSessionUpdate(const LLSD& session_update) +{ + // *TODO : verify following code when moderated mode will be implemented + if ( false && session_update.has("moderated_mode") && + session_update["moderated_mode"].has("voice") ) + { + BOOL voice_moderated = session_update["moderated_mode"]["voice"]; + const std::string session_label = LLIMModel::instance().getName(mSessionID); + + if (voice_moderated) + { + setTitle(session_label + std::string(" ") + LLTrans::getString("IM_moderated_chat_label")); + } + else + { + setTitle(session_label); + } + + // *TODO : uncomment this when/if LLPanelActiveSpeakers panel will be added + //update the speakers dropdown too + //mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); + } +} + void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info) { // We may have lost a "stop-typing" packet, don't add it twice diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 3559e14c89..4097f11f56 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -88,6 +88,7 @@ public: void onVisibilityChange(const LLSD& new_visibility); void processIMTyping(const LLIMInfo* im_info, BOOL typing); + void processSessionUpdate(const LLSD& session_update); private: // process focus events to set a currently active session diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 2e5e23c845..a716145590 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -2120,6 +2120,15 @@ public: } } + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if ( im_floater ) + { + if ( body.has("session_info") ) + { + im_floater->processSessionUpdate(body["session_info"]); + } + } + gIMMgr->clearPendingAgentListUpdates(session_id); } else @@ -2217,11 +2226,17 @@ public: const LLSD& context, const LLSD& input) const { - LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(input["body"]["session_id"].asUUID()); + LLUUID session_id = input["body"]["session_id"].asUUID(); + LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id); if (floaterp) { floaterp->processSessionUpdate(input["body"]["info"]); } + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if ( im_floater ) + { + im_floater->processSessionUpdate(input["body"]["info"]); + } } }; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7efda2b882..7e9585d4bd 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2884,6 +2884,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. -- Instant message logging enabled -- [NAME] is typing... (Unnamed) + (Moderated: Voices off by default) + Joining Voice Chat... -- cgit v1.2.3 From a999e50a8ebb3ab641490294d67dbbd6eb0c8898 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Wed, 28 Oct 2009 16:14:52 +0200 Subject: Implemented major sub-task EXT-1912 ( Add handling restrictions of PSTN P2P calls in new IM Floaters ) --HG-- branch : product-engine --- indra/newview/llimfloater.cpp | 23 ++++++++++++++++++----- indra/newview/llimview.cpp | 6 +++++- indra/newview/llimview.h | 3 +++ indra/newview/llpanelimcontrolpanel.cpp | 12 ++++++++++-- indra/newview/skins/default/xui/en/strings.xml | 1 + 5 files changed, 37 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b8b0290b18..2f060acb50 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -240,6 +240,15 @@ BOOL LLIMFloater::postBuild() mTypingStart = LLTrans::getString("IM_typing_start_string"); + // Disable input editor if session cannot accept text + LLIMModel::LLIMSession* im_session = + LLIMModel::instance().findIMSession(mSessionID); + if( im_session && !im_session->mTextIMPossible ) + { + mInputEditor->setEnabled(FALSE); + mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); + } + //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) @@ -249,8 +258,6 @@ BOOL LLIMFloater::postBuild() // virtual void LLIMFloater::draw() { - - if ( mMeTyping ) { // Time out if user hasn't typed for a while. @@ -259,6 +266,7 @@ void LLIMFloater::draw() setTyping(false); } } + LLFloater::draw(); } @@ -474,9 +482,14 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* { LLIMFloater* self= (LLIMFloater*) userdata; - //in disconnected state IM input editor should be disabled - self->mInputEditor->setEnabled(!gDisconnected); - + // Allow enabling the LLIMFloater input editor only if session can accept text + LLIMModel::LLIMSession* im_session = + LLIMModel::instance().findIMSession(self->mSessionID); + if( im_session && im_session->mTextIMPossible ) + { + //in disconnected state IM input editor should be disabled + self->mInputEditor->setEnabled(!gDisconnected); + } self->mChatHistory->setCursorAndScrollToEnd(); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index a716145590..b429ae8cf4 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -146,7 +146,9 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mVoiceChannel(NULL), mSpeakers(NULL), mSessionInitialized(false), - mCallBackEnabled(true) + mCallBackEnabled(true), + mTextIMPossible(true), + mProfileButtonEnabled(true) { if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type) { @@ -174,6 +176,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& if (IM_NOTHING_SPECIAL == type) { mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID); + mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionID); + mProfileButtonEnabled = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID); } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index f09c5a9521..80b54d7ef0 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -74,6 +74,9 @@ public: //true if calling back the session URI after the session has closed is possible. //Currently this will be false only for PSTN P2P calls. bool mCallBackEnabled; + + bool mTextIMPossible; + bool mProfileButtonEnabled; }; diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 6678a3a460..c70d903fb0 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -130,12 +130,20 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); - LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id); + LLIMModel& im_model = LLIMModel::instance(); + + LLUUID avatar_id = im_model.getOtherParticipantID(session_id); // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(avatar_id)); - + getChild("avatar_icon")->setValue(avatar_id); + + // Disable profile button if participant is not realy SL avatar + LLIMModel::LLIMSession* im_session = + im_model.findIMSession(session_id); + if( im_session && !im_session->mProfileButtonEnabled ) + childSetEnabled("view_profile_btn", FALSE); } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 7e9585d4bd..8609d07be9 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2885,6 +2885,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. [NAME] is typing... (Unnamed) (Moderated: Voices off by default) + Text chat is not available for this call. -- cgit v1.2.3