summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcallfloater.cpp24
-rw-r--r--indra/newview/llcallfloater.h8
-rw-r--r--indra/newview/llimview.cpp22
-rw-r--r--indra/newview/llspeakbutton.cpp3
-rw-r--r--indra/newview/llvoicechannel.cpp5
5 files changed, 51 insertions, 11 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index b1e530d323..20739d2401 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -42,6 +42,8 @@
#include "llagentdata.h" // for gAgentID
#include "llavatarlist.h"
#include "llbottomtray.h"
+#include "llimfloater.h"
+#include "llfloaterreg.h"
#include "llparticipantlist.h"
#include "llspeakers.h"
#include "lltransientfloatermgr.h"
@@ -95,7 +97,6 @@ LLCallFloater::LLCallFloater(const LLSD& key)
LLCallFloater::~LLCallFloater()
{
- mChannelChangedConnection.disconnect();
delete mPaticipants;
mPaticipants = NULL;
@@ -128,8 +129,6 @@ BOOL LLCallFloater::postBuild()
// update list for current session
updateSession();
- // subscribe to to be notified Voice Channel is changed
- mChannelChangedConnection = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::onCurrentChannelChanged, this, _1));
return TRUE;
}
@@ -245,6 +244,17 @@ void LLCallFloater::updateSession()
refreshPartisipantList();
updateModeratorState();
+
+ //show floater for voice calls
+ if (!is_local_chat)
+ {
+ LLIMFloater* im_floater = LLIMFloater::findInstance(session_id);
+ bool show_me = !(im_floater && im_floater->getVisible());
+ if (show_me)
+ {
+ setVisible(true);
+ }
+ }
}
void LLCallFloater::refreshPartisipantList()
@@ -280,7 +290,7 @@ void LLCallFloater::refreshPartisipantList()
}
}
-void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
+void LLCallFloater::sOnCurrentChannelChanged(const LLUUID& /*session_id*/)
{
// Don't update participant list if no channel info is available.
// Fix for ticket EXT-3427
@@ -290,9 +300,11 @@ void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
{
return;
}
+ LLCallFloater* call_floater = LLFloaterReg::getTypedInstance<LLCallFloater>("voice_controls");
+
// Forget speaker manager from the previous session to avoid using it after session was destroyed.
- mSpeakerManager = NULL;
- updateSession();
+ call_floater->mSpeakerManager = NULL;
+ call_floater->updateSession();
}
void LLCallFloater::updateTitle()
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index b2288a42ff..f9c9149085 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -70,6 +70,8 @@ public:
*/
/*virtual*/ void onChange();
+ static void sOnCurrentChannelChanged(const LLUUID& session_id);
+
private:
typedef enum e_voice_controls_type
{
@@ -93,7 +95,9 @@ private:
* Refreshes participant list according to current Voice Channel
*/
void refreshPartisipantList();
- void onCurrentChannelChanged(const LLUUID& session_id);
+
+
+
void updateTitle();
void initAgentData();
void setModeratorMutedVoice(bool moderator_muted);
@@ -108,8 +112,6 @@ private:
LLPanel* mAgentPanel;
LLOutputMonitorCtrl* mSpeakingIndicator;
bool mIsModeratorMutedVoice;
-
- boost::signals2::connection mChannelChangedConnection;
};
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index a1429d75a2..f5362acbfe 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1316,6 +1316,28 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id)
sPreviousSessionlName = sCurrentSessionlName;
sCurrentSessionlName = session->mName;
}
+
+ if (LLVoiceChannel::getCurrentVoiceChannel()->getState() == LLVoiceChannel::STATE_CALL_STARTED &&
+ LLVoiceChannel::getCurrentVoiceChannel()->getCallDirection() == LLVoiceChannel::OUTGOING_CALL)
+ {
+
+ //*TODO get rid of duplicated code
+ LLSD mCallDialogPayload;
+ mCallDialogPayload["session_id"] = sSession->mSessionID;
+ mCallDialogPayload["session_name"] = sSession->mName;
+ mCallDialogPayload["other_user_id"] = sSession->mOtherParticipantID;
+ mCallDialogPayload["old_channel_name"] = sPreviousSessionlName;
+ mCallDialogPayload["state"] = LLVoiceChannel::STATE_CALL_STARTED;
+ mCallDialogPayload["disconnected_channel_name"] = sSession->mName;
+ mCallDialogPayload["session_type"] = sSession->mSessionType;
+
+ LLOutgoingCallDialog* ocd = LLFloaterReg::getTypedInstance<LLOutgoingCallDialog>("outgoing_call", LLOutgoingCallDialog::OCD_KEY);
+ if(ocd)
+ {
+ ocd->show(mCallDialogPayload);
+ }
+ }
+
}
void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction)
diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp
index 5edc4804ca..fd39bde118 100644
--- a/indra/newview/llspeakbutton.cpp
+++ b/indra/newview/llspeakbutton.cpp
@@ -119,6 +119,9 @@ LLSpeakButton::LLSpeakButton(const Params& p)
// never show "muted" because you can't mute yourself
mOutputMonitor->setIsMuted(false);
mOutputMonitor->setIsAgentControl(true);
+
+ //*TODO find a better place to do that
+ LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::sOnCurrentChannelChanged, _1));
}
LLSpeakButton::~LLSpeakButton()
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 60a2c3b638..69d2458217 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -316,8 +316,6 @@ void LLVoiceChannel::activate()
}
}
- sCurrentVoiceChannelChangedSignal(this->mSessionID);
-
if (mState == STATE_NO_CHANNEL_INFO)
{
// responsible for setting status to active
@@ -327,6 +325,9 @@ void LLVoiceChannel::activate()
{
setState(STATE_CALL_STARTED);
}
+
+ //do not send earlier, channel should be initialized, should not be in STATE_NO_CHANNEL_INFO state
+ sCurrentVoiceChannelChangedSignal(this->mSessionID);
}
void LLVoiceChannel::getChannelInfo()