Use conference.getChatRoom() instead of searching it, enable text stream for scheduled meetings & group calls

This commit is contained in:
Sylvain Berfini 2024-11-13 09:37:53 +01:00
parent 68fe26e05f
commit 416f4ffef0
4 changed files with 16 additions and 5 deletions

View file

@ -28,7 +28,6 @@ import org.linphone.core.Address
import org.linphone.core.Call
import org.linphone.core.Conference
import org.linphone.core.ConferenceListenerStub
import org.linphone.core.ConferenceParams
import org.linphone.core.MediaDirection
import org.linphone.core.Participant
import org.linphone.core.ParticipantDevice
@ -322,9 +321,7 @@ class ConferenceViewModel @UiThread constructor() : GenericViewModel() {
fun goToConversation() {
coreContext.postOnCoreThread { core ->
Log.i("$TAG Navigating to conference's conversation")
val chatParams: ConferenceParams? = null
val address = conference.conferenceAddress
val chatRoom = core.searchChatRoom(chatParams, address, null, null)
val chatRoom = conference.chatRoom
if (chatRoom != null) {
goToConversationEvent.postValue(
Event(
@ -335,7 +332,9 @@ class ConferenceViewModel @UiThread constructor() : GenericViewModel() {
)
)
} else {
Log.e("$TAG Couldn't find chat room for address [${address?.asStringUriOnly()}]")
Log.e(
"$TAG No chat room available for current conference [${conference.conferenceAddress?.asStringUriOnly()}]"
)
}
}
}

View file

@ -34,6 +34,7 @@ import org.linphone.core.ConferenceSchedulerListenerStub
import org.linphone.core.Factory
import org.linphone.core.Participant
import org.linphone.core.ParticipantInfo
import org.linphone.core.StreamType
import org.linphone.core.tools.Log
import org.linphone.ui.GenericViewModel
import org.linphone.utils.Event
@ -218,6 +219,9 @@ abstract class AbstractConversationViewModel : GenericViewModel() {
conferenceInfo.organizer = account.params.identityAddress
conferenceInfo.subject = chatRoom.subject
// Allows to have a chat room within the conference
conferenceInfo.setCapability(StreamType.Text, true)
val participants = arrayOfNulls<ParticipantInfo>(chatRoom.participants.size)
var index = 0
for (participant in chatRoom.participants) {

View file

@ -33,6 +33,7 @@ import org.linphone.core.ConferenceSchedulerListenerStub
import org.linphone.core.Factory
import org.linphone.core.Participant
import org.linphone.core.ParticipantInfo
import org.linphone.core.StreamType
import org.linphone.core.tools.Log
import org.linphone.ui.main.history.model.NumpadModel
import org.linphone.ui.main.viewmodel.AddressSelectionViewModel
@ -220,6 +221,9 @@ class StartCallViewModel @UiThread constructor() : AddressSelectionViewModel() {
conferenceInfo.organizer = account.params.identityAddress
conferenceInfo.subject = subject.value
// Allows to have a chat room within the conference
conferenceInfo.setCapability(StreamType.Text, true)
val participants = arrayOfNulls<ParticipantInfo>(selection.value.orEmpty().size)
var index = 0
for (participant in selection.value.orEmpty()) {

View file

@ -37,6 +37,7 @@ import org.linphone.core.ConferenceSchedulerListenerStub
import org.linphone.core.Factory
import org.linphone.core.Participant
import org.linphone.core.ParticipantInfo
import org.linphone.core.StreamType
import org.linphone.core.tools.Log
import org.linphone.ui.GenericViewModel
import org.linphone.ui.main.meetings.model.TimeZoneModel
@ -409,6 +410,9 @@ class ScheduleMeetingViewModel @UiThread constructor() : GenericViewModel() {
conferenceInfo.subject = subject.value
conferenceInfo.description = description.value
// Allows to have a chat room within the conference
conferenceInfo.setCapability(StreamType.Text, true)
val startTime = startTimestamp / 1000 // Linphone expects timestamp in seconds
val duration =
(((endTimestamp - startTimestamp) / 1000) / 60).toInt() // Linphone expects duration in minutes