viewer-private#260 The 'Speak' button looks disabled during IM voice chat

p2p channels was reusing obsolete channel info
master
Andrey Kleshchev 2024-08-13 19:31:48 +03:00 committed by Andrey Kleshchev
parent bf3e2e2b17
commit ab86e77818
3 changed files with 20 additions and 1 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;