Prevent 'Remote Conference' default subject from being visible when joining a conference, using real one instead

This commit is contained in:
Sylvain Berfini 2022-06-08 09:32:11 +02:00
parent 0b06e22258
commit 0ce885a260
3 changed files with 20 additions and 19 deletions

View file

@ -30,7 +30,6 @@ import org.linphone.compatibility.Compatibility
import org.linphone.contact.GenericContactData
import org.linphone.core.*
import org.linphone.core.tools.Log
import org.linphone.utils.AppUtils
import org.linphone.utils.LinphoneUtils
open class CallData(val call: Call) : GenericContactData(call.remoteAddress) {
@ -232,15 +231,7 @@ open class CallData(val call: Call) : GenericContactData(call.remoteAddress) {
isInRemoteConference.value = conference != null
if (conference != null) {
Log.d("[Call] Found conference attached to call")
remoteConferenceSubject.value = if (conference.subject.isNullOrEmpty()) {
if (conference.me.isFocus) {
AppUtils.getString(R.string.conference_local_title)
} else {
AppUtils.getString(R.string.conference_default_title)
}
} else {
conference.subject
}
remoteConferenceSubject.value = LinphoneUtils.getConferenceSubject(conference)
Log.d("[Call] Found conference related to this call with subject [${remoteConferenceSubject.value}]")
val participantsList = arrayListOf<ConferenceInfoParticipantData>()

View file

@ -264,6 +264,7 @@ class ConferenceViewModel : ViewModel() {
conference.addListener(conferenceListener)
isRecording.value = conference.isRecording
subject.value = LinphoneUtils.getConferenceSubject(conference)
updateConferenceLayout(conference)
}
@ -278,15 +279,7 @@ class ConferenceViewModel : ViewModel() {
isConferenceLocallyPaused.value = !conference.isIn
isMeAdmin.value = conference.me.isAdmin
isVideoConference.value = conference.currentParams.isVideoEnabled
subject.value = if (conference.subject.isNullOrEmpty()) {
if (conference.me.isFocus) {
AppUtils.getString(R.string.conference_local_title)
} else {
AppUtils.getString(R.string.conference_default_title)
}
} else {
conference.subject
}
subject.value = LinphoneUtils.getConferenceSubject(conference)
updateConferenceLayout(conference)
}

View file

@ -87,6 +87,23 @@ class LinphoneUtils {
return conferenceAddress
}
fun getConferenceSubject(conference: Conference): String? {
return if (conference.subject.isNullOrEmpty()) {
val conferenceInfo = coreContext.core.findConferenceInformationFromUri(conference.conferenceAddress)
if (conferenceInfo != null) {
conferenceInfo.subject
} else {
if (conference.me.isFocus) {
AppUtils.getString(R.string.conference_local_title)
} else {
AppUtils.getString(R.string.conference_default_title)
}
}
} else {
conference.subject
}
}
fun isLimeAvailable(): Boolean {
val core = coreContext.core
return core.limeX3DhAvailable() && core.isLimeX3DhEnabled &&