From ca1d0c82edc361aeaa39678d7fc8983771cc0a28 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 27 Nov 2009 12:49:05 +0200 Subject: partial fix for major sub-task (EXT-2211) Add textual indication (IM messages) about incoming voice calls and reactions on them (All types of IMs) implemented "Started a voice call" and "Joined the voice call" IM notifications for p2p voice chat. --HG-- branch : product-engine --- indra/newview/llimview.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c096b5220a..9a0dcc11e5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -165,6 +165,11 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& { mVoiceChannel = new LLVoiceChannelGroup(session_id, name); } + + if(mVoiceChannel) + { + mVoiceChannel->setStateChangedCallback(boost::bind(&LLIMSession::onVoiceChannelStateChanged, this, _1, _2)); + } mSpeakers = new LLIMSpeakerMgr(mVoiceChannel); // All participants will be added to the list of people we've recently interacted with. @@ -191,6 +196,48 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& LLLogChat::loadHistory(mName, &chatFromLogFile, (void *)this); } +void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) +{ + bool is_p2p_session = dynamic_cast(mVoiceChannel); + bool is_incoming_call = false; + std::string other_avatar_name; + + if(is_p2p_session) + { + is_incoming_call = static_cast(mVoiceChannel)->isIncomingCall(); + gCacheName->getFullName(mOtherParticipantID, other_avatar_name); + + if(is_incoming_call) + { + switch(new_state) + { + case LLVoiceChannel::STATE_CALL_STARTED : + LLIMModel::getInstance()->addMessage(mSessionID, other_avatar_name, mOtherParticipantID, "Started a voice call"); + break; + case LLVoiceChannel::STATE_CONNECTED : + LLIMModel::getInstance()->addMessage(mSessionID, "You", gAgent.getID(), "Joined the voice call"); + break; + } + } + else // outgoing call + { + switch(new_state) + { + case LLVoiceChannel::STATE_CALL_STARTED : + LLIMModel::getInstance()->addMessage(mSessionID, "You", gAgent.getID(), "Started a voice call"); + break; + case LLVoiceChannel::STATE_CONNECTED : + LLIMModel::getInstance()->addMessage(mSessionID, other_avatar_name, mOtherParticipantID, "Joined the voice call"); + break; + } + } + } + else // group || ad-hoc calls + { + + } +} + LLIMModel::LLIMSession::~LLIMSession() { delete mSpeakers; -- cgit v1.2.3 From 00fe55c9b619a4f53f36dcb5217305abe42ca3cb Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 27 Nov 2009 13:25:08 +0200 Subject: fix linux build (no default section in switch) --HG-- branch : product-engine --- indra/newview/llimview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9a0dcc11e5..1451448b0b 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -216,6 +216,7 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES break; case LLVoiceChannel::STATE_CONNECTED : LLIMModel::getInstance()->addMessage(mSessionID, "You", gAgent.getID(), "Joined the voice call"); + default: break; } } @@ -228,6 +229,7 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES break; case LLVoiceChannel::STATE_CONNECTED : LLIMModel::getInstance()->addMessage(mSessionID, other_avatar_name, mOtherParticipantID, "Joined the voice call"); + default: break; } } -- cgit v1.2.3 From 8b802a69c7c836e179336576df9de04a9cad5de3 Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Fri, 27 Nov 2009 14:53:38 +0200 Subject: implemented normal sub-task (EXT-2800) Voice calls notification windows and dialogs should be shown/docked over the speak button's chevron changed dock-control from the SysWell to the SpeakButton for outgoing and incoming voice dialogs --HG-- branch : product-engine --- indra/newview/llimview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 1451448b0b..dff339fa63 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1199,7 +1199,7 @@ BOOL LLOutgoingCallDialog::postBuild() childSetAction("Cancel", onCancel, this); // dock the dialog to the sys well, where other sys messages appear - setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), + setDockControl(new LLDockControl(LLBottomTray::getInstance()->getChild("speak_panel"), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLOutgoingCallDialog::getAllowedRect, this, _1))); @@ -1276,7 +1276,7 @@ void LLIncomingCallDialog::onOpen(const LLSD& key) } // dock the dialog to the sys well, where other sys messages appear - setDockControl(new LLDockControl(LLBottomTray::getInstance()->getSysWell(), + setDockControl(new LLDockControl(LLBottomTray::getInstance()->getChild("speak_panel"), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLIncomingCallDialog::getAllowedRect, this, _1))); } -- cgit v1.2.3 From f0426b924f543c62268ac5098c0c2c6a44e68084 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Sat, 28 Nov 2009 17:43:21 +0200 Subject: implemented EXT-2889 "Incoming "grant modify rights" message should trigger notify toast and adding record to IM history"; fixed avatar icon in IM-floater when message added to IM-session; avoided popup of IM-tast when message added to IM-session; --HG-- branch : product-engine --- indra/newview/llimview.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index dff339fa63..2f88578739 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -476,19 +476,17 @@ bool LLIMModel::proccessOnlineOfflineNotification( } bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, - const std::string& utf8_text, bool log2file /* = true */) { + const std::string& utf8_text, bool log2file /* = true */) +{ LLIMSession* session = findIMSession(session_id); - if (!session) + if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; return false; } - addToHistory(session_id, from, from_id, utf8_text); - if (log2file) logToFile(session_id, from, from_id, utf8_text); - - session->mNumUnread++; + addMessageSilently(*session, from, from_id, utf8_text, log2file); // notify listeners LLSD arg; @@ -503,6 +501,15 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co return true; } +void LLIMModel::addMessageSilently(LLIMSession& session, const std::string& from, const LLUUID& from_id, + const std::string& utf8_text, bool log2file /* = true */) +{ + addToHistory(session.mSessionID, from, from_id, utf8_text); + if (log2file) logToFile(session.mSessionID, from, from_id, utf8_text); + + session.mNumUnread++; +} + const std::string& LLIMModel::getName(const LLUUID& session_id) const { -- cgit v1.2.3