summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-02-07 13:22:28 -0800
committerRoxie Linden <roxie@lindenlab.com>2024-02-08 18:37:09 -0800
commitd0cf247c2af3fbbdd023afe7abac8b7d83f9f8b9 (patch)
tree031c152f5ca7fd82df29b5f78a716e260098a77b /indra/newview
parent90efc71ef9f0fa43d6b3b8d2ebc8bda1556b669f (diff)
P2P checkpoint
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp11
-rw-r--r--indra/newview/llimview.h3
-rw-r--r--indra/newview/llvoicechannel.cpp11
-rw-r--r--indra/newview/llvoicechannel.h3
-rw-r--r--indra/newview/llvoicewebrtc.cpp2
5 files changed, 18 insertions, 12 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 78017337e8..a6eeaeffc6 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -674,8 +674,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
}
else
{
- mVoiceChannel = new LLVoiceChannelGroup(session_id, name);
-
// determine whether it is group or conference session
if (gAgent.isInGroup(mSessionID))
{
@@ -690,6 +688,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&
// webrtc uses adhoc channels for p2p
mSessionType = P2P_SESSION;
}
+ mVoiceChannel = new LLVoiceChannelGroup(session_id, name, mSessionType == P2P_SESSION);
}
if(mVoiceChannel)
@@ -3432,7 +3431,8 @@ void LLIMMgr::inviteToSession(
EInstantMessage type,
EInvitationType inv_type,
const std::string& session_handle,
- const std::string& session_uri)
+ const std::string& session_uri,
+ const std::string& voice_server_type)
{
std::string notify_box_type;
// voice invite question is different from default only for group call (EXT-7118)
@@ -4153,12 +4153,15 @@ public:
return;
}
+ std::string voice_server_type = input["body"]["voice"].get("voice_server_type").asString();
+ BOOL session_type_p2p = input["body"]["voice"].get("p2p").asBoolean();
+
gIMMgr->inviteToSession(
input["body"]["session_id"].asUUID(),
input["body"]["session_name"].asString(),
input["body"]["from_id"].asUUID(),
input["body"]["from_name"].asString(),
- IM_SESSION_INVITE,
+ session_type_p2p ? IM_SESSION_P2P_INVITE : IM_SESSION_INVITE,
LLIMMgr::INVITATION_TYPE_VOICE);
}
else if ( input["body"].has("immediate") )
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 946eb02f26..49c73bd495 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -417,7 +417,8 @@ public:
EInstantMessage type,
EInvitationType inv_type,
const std::string& session_handle = LLStringUtil::null,
- const std::string& session_uri = LLStringUtil::null);
+ const std::string& session_uri = LLStringUtil::null,
+ const std::string& voice_server_type = LLStringUtil::null);
void processIMTypingStart(const LLUUID& from_id, const EInstantMessage im_type);
void processIMTypingStop(const LLUUID& from_id, const EInstantMessage im_type);
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 05c22dd645..4ca876bed1 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -410,8 +410,9 @@ boost::signals2::connection LLVoiceChannel::setCurrentVoiceChannelChangedCallbac
// LLVoiceChannelGroup
//
-LLVoiceChannelGroup::LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name) :
- LLVoiceChannel(session_id, session_name)
+LLVoiceChannelGroup::LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name, BOOL hangup_on_last_leave) :
+ LLVoiceChannel(session_id, session_name),
+ mHangupOnLastLeave(hangup_on_last_leave)
{
mRetries = DEFAULT_RETRIES_COUNT;
mIsRetrying = FALSE;
@@ -438,7 +439,7 @@ void LLVoiceChannelGroup::activate()
LLVoiceClient::getInstance()->setNonSpatialChannel(
mURI,
mCredentials,
- !LLVoiceClient::getInstance()->hasP2PInterface());
+ mHangupOnLastLeave);
if (!gAgent.isInGroup(mSessionID)) // ad-hoc channel
{
@@ -520,7 +521,7 @@ void LLVoiceChannelGroup::setChannelInfo(
LLVoiceClient::getInstance()->setNonSpatialChannel(
mURI,
mCredentials,
- !LLVoiceClient::getInstance()->hasP2PInterface());
+ mHangupOnLastLeave);
}
}
@@ -792,7 +793,7 @@ void LLVoiceChannelProximal::deactivate()
// LLVoiceChannelP2P
//
LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string& session_name, const LLUUID& other_user_id) :
- LLVoiceChannelGroup(session_id, session_name),
+ LLVoiceChannelGroup(session_id, session_name, true),
mOtherUserID(other_user_id),
mReceivedCall(FALSE)
{
diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h
index 309c3eebdd..84ef3e7c08 100644
--- a/indra/newview/llvoicechannel.h
+++ b/indra/newview/llvoicechannel.h
@@ -144,7 +144,7 @@ private:
class LLVoiceChannelGroup : public LLVoiceChannel
{
public:
- LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name);
+ LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name, BOOL hangup_on_last_leave);
/*virtual*/ void handleStatusChange(EStatusType status);
/*virtual*/ void handleError(EStatusType status);
@@ -163,6 +163,7 @@ private:
U32 mRetries;
BOOL mIsRetrying;
+ BOOL mHangupOnLastLeave;
};
class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton<LLVoiceChannelProximal>
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 7b85795697..399db275ab 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -3029,7 +3029,7 @@ void LLVoiceWebRTCConnection::sendJoin()
Json::Value root = Json::objectValue;
Json::Value join_obj = Json::objectValue;
LLUUID regionID = gAgent.getRegion()->getRegionID();
- if (regionID == mRegionID)
+ if ((regionID == mRegionID) || !isSpatial())
{
join_obj["p"] = true;
}