summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicechannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicechannel.cpp')
-rw-r--r--indra/newview/llvoicechannel.cpp39
1 files changed, 27 insertions, 12 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 917d69fe16..7bb1006e93 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -122,7 +122,8 @@ LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& sess
mState(STATE_NO_CHANNEL_INFO),
mSessionName(session_name),
mCallDirection(OUTGOING_CALL),
- mIgnoreNextSessionLeave(FALSE)
+ mIgnoreNextSessionLeave(FALSE),
+ mCallEndedByAgent(false)
{
mNotifyArgs["VOICE_CHANNEL_NAME"] = mSessionName;
@@ -138,10 +139,10 @@ LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& sess
LLVoiceChannel::~LLVoiceChannel()
{
- // Don't use LLVoiceClient::getInstance() here -- this can get called during atexit() time and that singleton MAY have already been destroyed.
- if(gVoiceClient)
+ // Must check instance exists here, the singleton MAY have already been destroyed.
+ if(LLVoiceClient::instanceExists())
{
- gVoiceClient->removeObserver(this);
+ LLVoiceClient::instance().removeObserver(this);
}
sVoiceChannelMap.erase(mSessionID);
@@ -389,13 +390,16 @@ void LLVoiceChannel::setState(EState state)
switch(state)
{
case STATE_RINGING:
- gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs);
+ //TODO: remove or redirect this call status notification
+// LLCallInfoDialog::show("ringing", mNotifyArgs);
break;
case STATE_CONNECTED:
- gIMMgr->addSystemMessage(mSessionID, "connected", mNotifyArgs);
+ //TODO: remove or redirect this call status notification
+// LLCallInfoDialog::show("connected", mNotifyArgs);
break;
case STATE_HUNG_UP:
- gIMMgr->addSystemMessage(mSessionID, "hang_up", mNotifyArgs);
+ //TODO: remove or redirect this call status notification
+// LLCallInfoDialog::show("hang_up", mNotifyArgs);
break;
default:
break;
@@ -409,7 +413,7 @@ void LLVoiceChannel::doSetState(const EState& new_state)
EState old_state = mState;
mState = new_state;
if (!mStateChangedCallback.empty())
- mStateChangedCallback(old_state, mState, mCallDirection);
+ mStateChangedCallback(old_state, mState, mCallDirection, mCallEndedByAgent);
}
//static
@@ -635,7 +639,8 @@ void LLVoiceChannelGroup::setState(EState state)
case STATE_RINGING:
if ( !mIsRetrying )
{
- gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs);
+ //TODO: remove or redirect this call status notification
+// LLCallInfoDialog::show("ringing", mNotifyArgs);
}
doSetState(state);
@@ -698,7 +703,12 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status)
// do not notify user when leaving proximal channel
return;
case STATUS_VOICE_DISABLED:
- gIMMgr->addSystemMessage(LLUUID::null, "unavailable", mNotifyArgs);
+ //skip showing "Voice not available at your current location" when agent voice is disabled (EXT-4749)
+ if(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking())
+ {
+ //TODO: remove or redirect this call status notification
+// LLCallInfoDialog::show("unavailable", mNotifyArgs);
+ }
return;
default:
break;
@@ -770,7 +780,8 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type)
}
else
{
- // other user hung up
+ // other user hung up, so we didn't end the call
+ mCallEndedByAgent = false;
}
deactivate();
}
@@ -801,6 +812,9 @@ void LLVoiceChannelP2P::activate()
{
if (callStarted()) return;
+ //call will be counted as ended by user unless this variable is changed in handleStatusChange()
+ mCallEndedByAgent = true;
+
LLVoiceChannel::activate();
if (callStarted())
@@ -897,7 +911,8 @@ void LLVoiceChannelP2P::setState(EState state)
// so provide a special purpose message here
if (mReceivedCall && state == STATE_RINGING)
{
- gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs);
+ //TODO: remove or redirect this call status notification
+// LLCallInfoDialog::show("answering", mNotifyArgs);
doSetState(state);
return;
}