summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicechannel.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-19 19:59:03 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-19 19:59:03 +0800
commit495f103000137b3288eaa05a4298fd33ceb3c2dc (patch)
tree19b79a5cb33275a874d24e923a04de7b9657401b /indra/newview/llvoicechannel.cpp
parentb7a79709003b1f7f0451ba577576040fc03e50f9 (diff)
parent0f3ffb0fad721740f20ed5c7a74f4ceade6d46b6 (diff)
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/newview/llvoicechannel.cpp')
-rw-r--r--indra/newview/llvoicechannel.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 912b5a330e..eb1cd00940 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -81,10 +81,7 @@ LLVoiceChannel::~LLVoiceChannel()
{
sCurrentVoiceChannel = NULL;
// Must check instance exists here, the singleton MAY have already been destroyed.
- if(LLVoiceClient::instanceExists())
- {
- LLVoiceClient::getInstance()->removeObserver(this);
- }
+ LLVoiceClient::removeObserver(this);
}
sVoiceChannelMap.erase(mSessionID);
@@ -118,6 +115,12 @@ void LLVoiceChannel::setChannelInfo(const LLSD &channelInfo)
}
}
+void LLVoiceChannel::resetChannelInfo()
+{
+ mChannelInfo = LLSD();
+ mState = STATE_NO_CHANNEL_INFO;
+}
+
void LLVoiceChannel::onChange(EStatusType type, const LLSD& channelInfo, bool proximal)
{
LL_DEBUGS("Voice") << "Incoming channel info: " << channelInfo << LL_ENDL;
@@ -187,13 +190,13 @@ void LLVoiceChannel::handleError(EStatusType type)
setState(STATE_ERROR);
}
-bool LLVoiceChannel::isActive()
+bool LLVoiceChannel::isActive() const
{
// only considered active when currently bound channel matches what our channel
return callStarted() && LLVoiceClient::getInstance()->isCurrentChannel(mChannelInfo);
}
-bool LLVoiceChannel::callStarted()
+bool LLVoiceChannel::callStarted() const
{
return mState >= STATE_CALL_STARTED;
}
@@ -219,7 +222,7 @@ void LLVoiceChannel::deactivate()
LLVoiceClient::getInstance()->setUserPTTState(false);
}
}
- LLVoiceClient::getInstance()->removeObserver(this);
+ LLVoiceClient::removeObserver(this);
if (sCurrentVoiceChannel == this)
{
@@ -259,7 +262,7 @@ void LLVoiceChannel::activate()
setState(STATE_CALL_STARTED);
}
- LLVoiceClient::getInstance()->addObserver(this);
+ LLVoiceClient::addObserver(this);
//do not send earlier, channel should be initialized, should not be in STATE_NO_CHANNEL_INFO state
sCurrentVoiceChannelChangedSignal(this->mSessionID);
@@ -662,7 +665,7 @@ LLVoiceChannelProximal::LLVoiceChannelProximal() :
{
}
-bool LLVoiceChannelProximal::isActive()
+bool LLVoiceChannelProximal::isActive() const
{
return callStarted() && LLVoiceClient::getInstance()->inProximalChannel();
}
@@ -751,7 +754,7 @@ void LLVoiceChannelProximal::deactivate()
{
setState(STATE_HUNG_UP);
}
- LLVoiceClient::getInstance()->removeObserver(this);
+ LLVoiceClient::removeObserver(this);
LLVoiceClient::getInstance()->activateSpatialChannel(false);
}
@@ -918,6 +921,12 @@ void LLVoiceChannelP2P::setChannelInfo(const LLSD& channel_info)
}
}
+void LLVoiceChannelP2P::resetChannelInfo()
+{
+ mChannelInfo = LLVoiceClient::getInstance()->getP2PChannelInfoTemplate(mOtherUserID);
+ mState = STATE_NO_CHANNEL_INFO; // we have template, not full info
+}
+
void LLVoiceChannelP2P::setState(EState state)
{
LL_INFOS("Voice") << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << LL_ENDL;