summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-08-13 19:31:48 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-08-14 00:44:39 +0300
commitab86e77818e76bdf3ef660b9fa964217265be3e7 (patch)
treea688233eea89abe8538dd2f1ff50dbf711f4d3ad /indra/newview
parentbf3e2e2b172dffbe745092a062f48bb6bc8b269f (diff)
viewer-private#260 The 'Speak' button looks disabled during IM voice chat
p2p channels was reusing obsolete channel info
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp5
-rw-r--r--indra/newview/llvoicechannel.cpp12
-rw-r--r--indra/newview/llvoicechannel.h4
3 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index d3f013c67c..17b5af74d2 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3857,6 +3857,11 @@ bool LLIMMgr::startCall(const LLUUID& session_id, LLVoiceChannel::EDirection dir
{
voice_channel->setChannelInfo(voice_channel_info);
}
+ else if (voice_channel->getState() < LLVoiceChannel::STATE_READY)
+ {
+ // restart if there wa an error or it was hang up
+ voice_channel->resetChannelInfo();
+ }
voice_channel->setCallDirection(direction);
voice_channel->activate();
return true;
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 8cda7c76da..7f578171af 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -115,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;
@@ -915,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;
diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h
index 46a3f552cb..95fd247ca6 100644
--- a/indra/newview/llvoicechannel.h
+++ b/indra/newview/llvoicechannel.h
@@ -72,7 +72,8 @@ public:
virtual void handleError(EStatusType status);
virtual void deactivate();
virtual void activate();
- virtual void setChannelInfo(const LLSD &channelInfo);
+ virtual void setChannelInfo(const LLSD& channelInfo);
+ virtual void resetChannelInfo();
virtual void requestChannelInfo();
virtual bool isActive() const;
virtual bool callStarted() const;
@@ -189,6 +190,7 @@ class LLVoiceChannelP2P : public LLVoiceChannelGroup
void requestChannelInfo() override;
void deactivate() override;
void setChannelInfo(const LLSD& channel_info) override;
+ void resetChannelInfo() override;
protected:
void setState(EState state) override;