Fixed build with 5.3-alpha SDK due to enum relocations changes
This commit is contained in:
parent
981ee0ac8e
commit
4d90ee0f15
33 changed files with 129 additions and 129 deletions
|
@ -244,7 +244,7 @@ dependencies {
|
||||||
implementation 'com.google.firebase:firebase-messaging'
|
implementation 'com.google.firebase:firebase-messaging'
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation 'org.linphone:linphone-sdk-android:5.2+'
|
implementation 'org.linphone:linphone-sdk-android:5.3+'
|
||||||
|
|
||||||
// Only enable leak canary prior to release
|
// Only enable leak canary prior to release
|
||||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
|
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
|
||||||
|
|
|
@ -23,7 +23,7 @@ import androidx.lifecycle.MediatorLiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.core.ConfiguringState
|
import org.linphone.core.Config
|
||||||
import org.linphone.core.Core
|
import org.linphone.core.Core
|
||||||
import org.linphone.core.CoreListenerStub
|
import org.linphone.core.CoreListenerStub
|
||||||
import org.linphone.core.tools.Log
|
import org.linphone.core.tools.Log
|
||||||
|
@ -38,13 +38,17 @@ class RemoteProvisioningViewModel : ViewModel() {
|
||||||
val fetchSuccessfulEvent = MutableLiveData<Event<Boolean>>()
|
val fetchSuccessfulEvent = MutableLiveData<Event<Boolean>>()
|
||||||
|
|
||||||
private val listener = object : CoreListenerStub() {
|
private val listener = object : CoreListenerStub() {
|
||||||
override fun onConfiguringStatus(core: Core, status: ConfiguringState, message: String?) {
|
override fun onConfiguringStatus(
|
||||||
|
core: Core,
|
||||||
|
status: Config.ConfiguringState,
|
||||||
|
message: String?
|
||||||
|
) {
|
||||||
fetchInProgress.value = false
|
fetchInProgress.value = false
|
||||||
when (status) {
|
when (status) {
|
||||||
ConfiguringState.Successful -> {
|
Config.ConfiguringState.Successful -> {
|
||||||
fetchSuccessfulEvent.value = Event(true)
|
fetchSuccessfulEvent.value = Event(true)
|
||||||
}
|
}
|
||||||
ConfiguringState.Failed -> {
|
Config.ConfiguringState.Failed -> {
|
||||||
fetchSuccessfulEvent.value = Event(false)
|
fetchSuccessfulEvent.value = Event(false)
|
||||||
}
|
}
|
||||||
else -> {}
|
else -> {}
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
package org.linphone.activities.main.chat
|
package org.linphone.activities.main.chat
|
||||||
|
|
||||||
import org.linphone.core.Address
|
import org.linphone.core.Address
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoom
|
||||||
|
|
||||||
data class GroupChatRoomMember(
|
data class GroupChatRoomMember(
|
||||||
val address: Address,
|
val address: Address,
|
||||||
var isAdmin: Boolean = false,
|
var isAdmin: Boolean = false,
|
||||||
val securityLevel: ChatRoomSecurityLevel = ChatRoomSecurityLevel.ClearText,
|
val securityLevel: ChatRoom.SecurityLevel = ChatRoom.SecurityLevel.ClearText,
|
||||||
val hasLimeX3DHCapability: Boolean = false,
|
val hasLimeX3DHCapability: Boolean = false,
|
||||||
// A participant not yet added to a group can't be set admin at the same time it's added
|
// A participant not yet added to a group can't be set admin at the same time it's added
|
||||||
val canBeSetAdmin: Boolean = false
|
val canBeSetAdmin: Boolean = false
|
||||||
|
|
|
@ -365,7 +365,7 @@ class ChatMessagesListAdapter(
|
||||||
val itemSize = AppUtils.getDimension(R.dimen.chat_message_popup_item_height).toInt()
|
val itemSize = AppUtils.getDimension(R.dimen.chat_message_popup_item_height).toInt()
|
||||||
var totalSize = itemSize * 7
|
var totalSize = itemSize * 7
|
||||||
if (chatMessage.chatRoom.hasCapability(
|
if (chatMessage.chatRoom.hasCapability(
|
||||||
ChatRoomCapabilities.OneToOne.toInt()
|
ChatRoom.Capabilities.OneToOne.toInt()
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
// No message id
|
// No message id
|
||||||
|
|
|
@ -42,7 +42,7 @@ import org.linphone.utils.TimestampUtils
|
||||||
class ChatRoomData(val chatRoom: ChatRoom) : ContactDataInterface {
|
class ChatRoomData(val chatRoom: ChatRoom) : ContactDataInterface {
|
||||||
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
override val securityLevel: MutableLiveData<ChatRoom.SecurityLevel> = MutableLiveData<ChatRoom.SecurityLevel>()
|
||||||
override val showGroupChatAvatar: Boolean
|
override val showGroupChatAvatar: Boolean
|
||||||
get() = !oneToOneChatRoom
|
get() = !oneToOneChatRoom
|
||||||
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
|
@ -71,15 +71,15 @@ class ChatRoomData(val chatRoom: ChatRoom) : ContactDataInterface {
|
||||||
val notificationsMuted = MutableLiveData<Boolean>()
|
val notificationsMuted = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
private val basicChatRoom: Boolean by lazy {
|
private val basicChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.Basic.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.Basic.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val oneToOneChatRoom: Boolean by lazy {
|
val oneToOneChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.OneToOne.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val encryptedChatRoom: Boolean by lazy {
|
val encryptedChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.Encrypted.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.Encrypted.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val contactNewlyFoundEvent: MutableLiveData<Event<Boolean>> by lazy {
|
val contactNewlyFoundEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||||
|
@ -131,13 +131,13 @@ class ChatRoomData(val chatRoom: ChatRoom) : ContactDataInterface {
|
||||||
securityLevel.value = level
|
securityLevel.value = level
|
||||||
|
|
||||||
securityLevelIcon.value = when (level) {
|
securityLevelIcon.value = when (level) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
ChatRoom.SecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
ChatRoom.SecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||||
else -> R.drawable.security_alert_indicator
|
else -> R.drawable.security_alert_indicator
|
||||||
}
|
}
|
||||||
securityLevelContentDescription.value = when (level) {
|
securityLevelContentDescription.value = when (level) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
ChatRoom.SecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
ChatRoom.SecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||||
else -> R.string.content_description_security_level_unsafe
|
else -> R.string.content_description_security_level_unsafe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.linphone.activities.main.chat.data
|
||||||
|
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoom
|
||||||
import org.linphone.core.ParticipantDevice
|
import org.linphone.core.ParticipantDevice
|
||||||
|
|
||||||
class DevicesListChildData(private val device: ParticipantDevice) {
|
class DevicesListChildData(private val device: ParticipantDevice) {
|
||||||
|
@ -29,16 +29,16 @@ class DevicesListChildData(private val device: ParticipantDevice) {
|
||||||
|
|
||||||
val securityLevelIcon: Int by lazy {
|
val securityLevelIcon: Int by lazy {
|
||||||
when (device.securityLevel) {
|
when (device.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
ChatRoom.SecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
ChatRoom.SecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||||
else -> R.drawable.security_alert_indicator
|
else -> R.drawable.security_alert_indicator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val securityContentDescription: Int by lazy {
|
val securityContentDescription: Int by lazy {
|
||||||
when (device.securityLevel) {
|
when (device.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
ChatRoom.SecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
ChatRoom.SecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||||
else -> R.string.content_description_security_level_unsafe
|
else -> R.string.content_description_security_level_unsafe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.contact.GenericContactData
|
import org.linphone.contact.GenericContactData
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoom
|
||||||
import org.linphone.core.Participant
|
import org.linphone.core.Participant
|
||||||
import org.linphone.utils.LinphoneUtils
|
import org.linphone.utils.LinphoneUtils
|
||||||
|
|
||||||
|
@ -32,16 +32,16 @@ class DevicesListGroupData(private val participant: Participant) : GenericContac
|
||||||
) {
|
) {
|
||||||
val securityLevelIcon: Int by lazy {
|
val securityLevelIcon: Int by lazy {
|
||||||
when (participant.securityLevel) {
|
when (participant.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
ChatRoom.SecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
ChatRoom.SecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||||
else -> R.drawable.security_alert_indicator
|
else -> R.drawable.security_alert_indicator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val securityLevelContentDescription: Int by lazy {
|
val securityLevelContentDescription: Int by lazy {
|
||||||
when (participant.securityLevel) {
|
when (participant.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
ChatRoom.SecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
ChatRoom.SecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||||
else -> R.string.content_description_security_level_unsafe
|
else -> R.string.content_description_security_level_unsafe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.activities.main.chat.GroupChatRoomMember
|
import org.linphone.activities.main.chat.GroupChatRoomMember
|
||||||
import org.linphone.contact.GenericContactData
|
import org.linphone.contact.GenericContactData
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoom
|
||||||
import org.linphone.utils.LinphoneUtils
|
import org.linphone.utils.LinphoneUtils
|
||||||
|
|
||||||
class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericContactData(
|
class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericContactData(
|
||||||
|
@ -40,16 +40,16 @@ class GroupInfoParticipantData(val participant: GroupChatRoomMember) : GenericCo
|
||||||
|
|
||||||
val securityLevelIcon: Int by lazy {
|
val securityLevelIcon: Int by lazy {
|
||||||
when (participant.securityLevel) {
|
when (participant.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
ChatRoom.SecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
ChatRoom.SecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||||
else -> R.drawable.security_alert_indicator
|
else -> R.drawable.security_alert_indicator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val securityLevelContentDescription: Int by lazy {
|
val securityLevelContentDescription: Int by lazy {
|
||||||
when (participant.securityLevel) {
|
when (participant.securityLevel) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
ChatRoom.SecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
ChatRoom.SecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||||
else -> R.string.content_description_security_level_unsafe
|
else -> R.string.content_description_security_level_unsafe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1058,7 +1058,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
}
|
}
|
||||||
|
|
||||||
if (viewModel.ephemeralChatRoom) {
|
if (viewModel.ephemeralChatRoom) {
|
||||||
if (chatRoom.currentParams.ephemeralMode == ChatRoomEphemeralMode.AdminManaged) {
|
if (chatRoom.currentParams.ephemeralMode == ChatRoom.EphemeralMode.AdminManaged) {
|
||||||
if (chatRoom.me?.isAdmin == false) {
|
if (chatRoom.me?.isAdmin == false) {
|
||||||
Log.w(
|
Log.w(
|
||||||
"[Chat Room] Hiding ephemeral menu as mode is admin managed and we aren't admin"
|
"[Chat Room] Hiding ephemeral menu as mode is admin managed and we aren't admin"
|
||||||
|
|
|
@ -38,7 +38,6 @@ import org.linphone.activities.navigateToChatRoom
|
||||||
import org.linphone.activities.navigateToChatRoomCreation
|
import org.linphone.activities.navigateToChatRoomCreation
|
||||||
import org.linphone.core.Address
|
import org.linphone.core.Address
|
||||||
import org.linphone.core.ChatRoom
|
import org.linphone.core.ChatRoom
|
||||||
import org.linphone.core.ChatRoomCapabilities
|
|
||||||
import org.linphone.databinding.ChatRoomGroupInfoFragmentBinding
|
import org.linphone.databinding.ChatRoomGroupInfoFragmentBinding
|
||||||
import org.linphone.utils.AppUtils
|
import org.linphone.utils.AppUtils
|
||||||
import org.linphone.utils.DialogUtils
|
import org.linphone.utils.DialogUtils
|
||||||
|
@ -68,7 +67,7 @@ class GroupInfoFragment : SecureFragment<ChatRoomGroupInfoFragmentBinding>() {
|
||||||
|
|
||||||
adapter = GroupInfoParticipantsAdapter(
|
adapter = GroupInfoParticipantsAdapter(
|
||||||
viewLifecycleOwner,
|
viewLifecycleOwner,
|
||||||
chatRoom?.hasCapability(ChatRoomCapabilities.Encrypted.toInt()) ?: (viewModel.isEncrypted.value == true)
|
chatRoom?.hasCapability(ChatRoom.Capabilities.Encrypted.toInt()) ?: (viewModel.isEncrypted.value == true)
|
||||||
)
|
)
|
||||||
binding.participants.adapter = adapter
|
binding.participants.adapter = adapter
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
|
|
||||||
val voiceRecordPlayingPosition = MutableLiveData<Int>()
|
val voiceRecordPlayingPosition = MutableLiveData<Int>()
|
||||||
|
|
||||||
val imeFlags: Int = if (chatRoom.hasCapability(ChatRoomCapabilities.Encrypted.toInt())) {
|
val imeFlags: Int = if (chatRoom.hasCapability(ChatRoom.Capabilities.Encrypted.toInt())) {
|
||||||
// IME_FLAG_NO_PERSONALIZED_LEARNING is only available on Android 8 and newer
|
// IME_FLAG_NO_PERSONALIZED_LEARNING is only available on Android 8 and newer
|
||||||
Compatibility.getImeFlagsForSecureChatRoom()
|
Compatibility.getImeFlagsForSecureChatRoom()
|
||||||
} else {
|
} else {
|
||||||
|
@ -157,7 +157,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this::recorder.isInitialized) {
|
if (this::recorder.isInitialized) {
|
||||||
if (recorder.state != RecorderState.Closed) {
|
if (recorder.state != Recorder.State.Closed) {
|
||||||
recorder.close()
|
recorder.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
val message = createChatMessage()
|
val message = createChatMessage()
|
||||||
val isBasicChatRoom: Boolean = chatRoom.hasCapability(ChatRoomCapabilities.Basic.toInt())
|
val isBasicChatRoom: Boolean = chatRoom.hasCapability(ChatRoom.Capabilities.Basic.toInt())
|
||||||
|
|
||||||
var voiceRecord = false
|
var voiceRecord = false
|
||||||
if (isPendingVoiceRecord.value == true && recorder.file != null) {
|
if (isPendingVoiceRecord.value == true && recorder.file != null) {
|
||||||
|
@ -366,14 +366,14 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
when (recorder.state) {
|
when (recorder.state) {
|
||||||
RecorderState.Running -> Log.w("[Chat Message Sending] Recorder is already recording")
|
Recorder.State.Running -> Log.w("[Chat Message Sending] Recorder is already recording")
|
||||||
RecorderState.Paused -> {
|
Recorder.State.Paused -> {
|
||||||
Log.w("[Chat Message Sending] Recorder isn't closed, resuming recording")
|
Log.w("[Chat Message Sending] Recorder isn't closed, resuming recording")
|
||||||
recorder.start()
|
recorder.start()
|
||||||
}
|
}
|
||||||
RecorderState.Closed -> {
|
Recorder.State.Closed -> {
|
||||||
val extension = when (recorder.params.fileFormat) {
|
val extension = when (recorder.params.fileFormat) {
|
||||||
RecorderFileFormat.Mkv -> "mkv"
|
Recorder.FileFormat.Mkv -> "mkv"
|
||||||
else -> "wav"
|
else -> "wav"
|
||||||
}
|
}
|
||||||
val tempFileName = "voice-recording-${System.currentTimeMillis()}.$extension"
|
val tempFileName = "voice-recording-${System.currentTimeMillis()}.$extension"
|
||||||
|
@ -415,7 +415,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun cancelVoiceRecording() {
|
fun cancelVoiceRecording() {
|
||||||
if (recorder.state != RecorderState.Closed) {
|
if (recorder.state != Recorder.State.Closed) {
|
||||||
Log.i("[Chat Message Sending] Closing voice recorder")
|
Log.i("[Chat Message Sending] Closing voice recorder")
|
||||||
recorder.close()
|
recorder.close()
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun stopVoiceRecorder() {
|
private fun stopVoiceRecorder() {
|
||||||
if (recorder.state == RecorderState.Running) {
|
if (recorder.state == Recorder.State.Running) {
|
||||||
Log.i("[Chat Message Sending] Pausing / closing voice recorder")
|
Log.i("[Chat Message Sending] Pausing / closing voice recorder")
|
||||||
recorder.pause()
|
recorder.pause()
|
||||||
recorder.close()
|
recorder.close()
|
||||||
|
@ -516,9 +516,9 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
Log.i("[Chat Message Sending] Creating recorder for voice message")
|
Log.i("[Chat Message Sending] Creating recorder for voice message")
|
||||||
val recorderParams = coreContext.core.createRecorderParams()
|
val recorderParams = coreContext.core.createRecorderParams()
|
||||||
if (corePreferences.voiceMessagesFormatMkv) {
|
if (corePreferences.voiceMessagesFormatMkv) {
|
||||||
recorderParams.fileFormat = RecorderFileFormat.Mkv
|
recorderParams.fileFormat = Recorder.FileFormat.Mkv
|
||||||
} else {
|
} else {
|
||||||
recorderParams.fileFormat = RecorderFileFormat.Wav
|
recorderParams.fileFormat = Recorder.FileFormat.Wav
|
||||||
}
|
}
|
||||||
|
|
||||||
val recordingAudioDevice = AudioRouteUtils.getAudioRecordingDeviceForVoiceMessage()
|
val recordingAudioDevice = AudioRouteUtils.getAudioRecordingDeviceForVoiceMessage()
|
||||||
|
@ -580,7 +580,7 @@ class ChatMessageSendingViewModel(private val chatRoom: ChatRoom) : ViewModel()
|
||||||
private fun updateChatRoomReadOnlyState() {
|
private fun updateChatRoomReadOnlyState() {
|
||||||
isReadOnly.value = chatRoom.isReadOnly || (
|
isReadOnly.value = chatRoom.isReadOnly || (
|
||||||
chatRoom.hasCapability(
|
chatRoom.hasCapability(
|
||||||
ChatRoomCapabilities.Conference.toInt()
|
ChatRoom.Capabilities.Conference.toInt()
|
||||||
) && chatRoom.participants.isEmpty()
|
) && chatRoom.participants.isEmpty()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,13 +95,13 @@ class ChatMessagesListViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onConferenceJoined(chatRoom: ChatRoom, eventLog: EventLog) {
|
override fun onConferenceJoined(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||||
if (!chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())) {
|
if (!chatRoom.hasCapability(ChatRoom.Capabilities.OneToOne.toInt())) {
|
||||||
addEvent(eventLog)
|
addEvent(eventLog)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onConferenceLeft(chatRoom: ChatRoom, eventLog: EventLog) {
|
override fun onConferenceLeft(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||||
if (!chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())) {
|
if (!chatRoom.hasCapability(ChatRoom.Capabilities.OneToOne.toInt())) {
|
||||||
addEvent(eventLog)
|
addEvent(eventLog)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,15 +94,15 @@ class ChatRoomCreationViewModel : ContactsSelectionViewModel() {
|
||||||
|
|
||||||
val encrypted = secureChatMandatory || isEncrypted.value == true
|
val encrypted = secureChatMandatory || isEncrypted.value == true
|
||||||
val params: ChatRoomParams = coreContext.core.createDefaultChatRoomParams()
|
val params: ChatRoomParams = coreContext.core.createDefaultChatRoomParams()
|
||||||
params.backend = ChatRoomBackend.Basic
|
params.backend = ChatRoom.Backend.Basic
|
||||||
params.isGroupEnabled = false
|
params.isGroupEnabled = false
|
||||||
if (encrypted) {
|
if (encrypted) {
|
||||||
params.isEncryptionEnabled = true
|
params.isEncryptionEnabled = true
|
||||||
params.backend = ChatRoomBackend.FlexisipChat
|
params.backend = ChatRoom.Backend.FlexisipChat
|
||||||
params.ephemeralMode = if (corePreferences.useEphemeralPerDeviceMode) {
|
params.ephemeralMode = if (corePreferences.useEphemeralPerDeviceMode) {
|
||||||
ChatRoomEphemeralMode.DeviceManaged
|
ChatRoom.EphemeralMode.DeviceManaged
|
||||||
} else {
|
} else {
|
||||||
ChatRoomEphemeralMode.AdminManaged
|
ChatRoom.EphemeralMode.AdminManaged
|
||||||
}
|
}
|
||||||
params.ephemeralLifetime = 0 // Make sure ephemeral is disabled by default
|
params.ephemeralLifetime = 0 // Make sure ephemeral is disabled by default
|
||||||
Log.i(
|
Log.i(
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ChatRoomViewModelFactory(private val chatRoom: ChatRoom) :
|
||||||
class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterface {
|
class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterface {
|
||||||
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
override val securityLevel: MutableLiveData<ChatRoom.SecurityLevel> = MutableLiveData<ChatRoom.SecurityLevel>()
|
||||||
override val showGroupChatAvatar: Boolean
|
override val showGroupChatAvatar: Boolean
|
||||||
get() = conferenceChatRoom && !oneToOneChatRoom
|
get() = conferenceChatRoom && !oneToOneChatRoom
|
||||||
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
|
@ -74,23 +74,23 @@ class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterf
|
||||||
val ephemeralEnabled = MutableLiveData<Boolean>()
|
val ephemeralEnabled = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val basicChatRoom: Boolean by lazy {
|
val basicChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.Basic.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.Basic.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val oneToOneChatRoom: Boolean by lazy {
|
val oneToOneChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.OneToOne.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
private val conferenceChatRoom: Boolean by lazy {
|
private val conferenceChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.Conference.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.Conference.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val encryptedChatRoom: Boolean by lazy {
|
val encryptedChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.Encrypted.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.Encrypted.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val ephemeralChatRoom: Boolean by lazy {
|
val ephemeralChatRoom: Boolean by lazy {
|
||||||
chatRoom.hasCapability(ChatRoomCapabilities.Ephemeral.toInt())
|
chatRoom.hasCapability(ChatRoom.Capabilities.Ephemeral.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
val meAdmin: MutableLiveData<Boolean> by lazy {
|
val meAdmin: MutableLiveData<Boolean> by lazy {
|
||||||
|
@ -387,13 +387,13 @@ class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterf
|
||||||
securityLevel.value = level
|
securityLevel.value = level
|
||||||
|
|
||||||
securityLevelIcon.value = when (level) {
|
securityLevelIcon.value = when (level) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.drawable.security_2_indicator
|
ChatRoom.SecurityLevel.Safe -> R.drawable.security_2_indicator
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
ChatRoom.SecurityLevel.Encrypted -> R.drawable.security_1_indicator
|
||||||
else -> R.drawable.security_alert_indicator
|
else -> R.drawable.security_alert_indicator
|
||||||
}
|
}
|
||||||
securityLevelContentDescription.value = when (level) {
|
securityLevelContentDescription.value = when (level) {
|
||||||
ChatRoomSecurityLevel.Safe -> R.string.content_description_security_level_safe
|
ChatRoom.SecurityLevel.Safe -> R.string.content_description_security_level_safe
|
||||||
ChatRoomSecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
ChatRoom.SecurityLevel.Encrypted -> R.string.content_description_security_level_encrypted
|
||||||
else -> R.string.content_description_security_level_unsafe
|
else -> R.string.content_description_security_level_unsafe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ class GroupInfoViewModel(val chatRoom: ChatRoom?) : MessageNotifierViewModel() {
|
||||||
isMeAdmin.value = chatRoom == null || (chatRoom.me?.isAdmin == true && !chatRoom.isReadOnly)
|
isMeAdmin.value = chatRoom == null || (chatRoom.me?.isAdmin == true && !chatRoom.isReadOnly)
|
||||||
canLeaveGroup.value = chatRoom != null && !chatRoom.isReadOnly
|
canLeaveGroup.value = chatRoom != null && !chatRoom.isReadOnly
|
||||||
isEncrypted.value = corePreferences.forceEndToEndEncryptedChat || chatRoom?.hasCapability(
|
isEncrypted.value = corePreferences.forceEndToEndEncryptedChat || chatRoom?.hasCapability(
|
||||||
ChatRoomCapabilities.Encrypted.toInt()
|
ChatRoom.Capabilities.Encrypted.toInt()
|
||||||
) == true
|
) == true
|
||||||
|
|
||||||
if (chatRoom != null) updateParticipants()
|
if (chatRoom != null) updateParticipants()
|
||||||
|
@ -123,9 +123,9 @@ class GroupInfoViewModel(val chatRoom: ChatRoom?) : MessageNotifierViewModel() {
|
||||||
params.isGroupEnabled = true
|
params.isGroupEnabled = true
|
||||||
if (params.isEncryptionEnabled) {
|
if (params.isEncryptionEnabled) {
|
||||||
params.ephemeralMode = if (corePreferences.useEphemeralPerDeviceMode) {
|
params.ephemeralMode = if (corePreferences.useEphemeralPerDeviceMode) {
|
||||||
ChatRoomEphemeralMode.DeviceManaged
|
ChatRoom.EphemeralMode.DeviceManaged
|
||||||
} else {
|
} else {
|
||||||
ChatRoomEphemeralMode.AdminManaged
|
ChatRoom.EphemeralMode.AdminManaged
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
params.ephemeralLifetime = 0 // Make sure ephemeral is disabled by default
|
params.ephemeralLifetime = 0 // Make sure ephemeral is disabled by default
|
||||||
|
|
|
@ -337,7 +337,7 @@ class ConferenceWaitingRoomViewModel : MessageNotifierViewModel() {
|
||||||
fun setMosaicLayout() {
|
fun setMosaicLayout() {
|
||||||
Log.i("[Conference Waiting Room] Set default layout to Mosaic")
|
Log.i("[Conference Waiting Room] Set default layout to Mosaic")
|
||||||
|
|
||||||
callParams.conferenceVideoLayout = ConferenceLayout.Grid
|
callParams.conferenceVideoLayout = Conference.Layout.Grid
|
||||||
callParams.isVideoEnabled = isVideoAvailableInCore()
|
callParams.isVideoEnabled = isVideoAvailableInCore()
|
||||||
|
|
||||||
updateLayout()
|
updateLayout()
|
||||||
|
@ -350,7 +350,7 @@ class ConferenceWaitingRoomViewModel : MessageNotifierViewModel() {
|
||||||
fun setActiveSpeakerLayout() {
|
fun setActiveSpeakerLayout() {
|
||||||
Log.i("[Conference Waiting Room] Set default layout to ActiveSpeaker")
|
Log.i("[Conference Waiting Room] Set default layout to ActiveSpeaker")
|
||||||
|
|
||||||
callParams.conferenceVideoLayout = ConferenceLayout.ActiveSpeaker
|
callParams.conferenceVideoLayout = Conference.Layout.ActiveSpeaker
|
||||||
callParams.isVideoEnabled = isVideoAvailableInCore()
|
callParams.isVideoEnabled = isVideoAvailableInCore()
|
||||||
|
|
||||||
updateLayout()
|
updateLayout()
|
||||||
|
@ -437,7 +437,7 @@ class ConferenceWaitingRoomViewModel : MessageNotifierViewModel() {
|
||||||
selectedLayout.value = ConferenceDisplayMode.AUDIO_ONLY
|
selectedLayout.value = ConferenceDisplayMode.AUDIO_ONLY
|
||||||
} else {
|
} else {
|
||||||
selectedLayout.value = when (callParams.conferenceVideoLayout) {
|
selectedLayout.value = when (callParams.conferenceVideoLayout) {
|
||||||
ConferenceLayout.Grid -> ConferenceDisplayMode.GRID
|
Conference.Layout.Grid -> ConferenceDisplayMode.GRID
|
||||||
else -> ConferenceDisplayMode.ACTIVE_SPEAKER
|
else -> ConferenceDisplayMode.ACTIVE_SPEAKER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.contact.*
|
import org.linphone.contact.*
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoom.SecurityLevel
|
||||||
import org.linphone.core.ConsolidatedPresence
|
import org.linphone.core.ConsolidatedPresence
|
||||||
import org.linphone.core.Friend
|
import org.linphone.core.Friend
|
||||||
import org.linphone.core.tools.Log
|
import org.linphone.core.tools.Log
|
||||||
|
@ -42,7 +42,7 @@ import org.linphone.utils.PermissionHelper
|
||||||
class ContactEditorData(val friend: Friend?) : ContactDataInterface {
|
class ContactEditorData(val friend: Friend?) : ContactDataInterface {
|
||||||
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
override val securityLevel: MutableLiveData<SecurityLevel> = MutableLiveData<SecurityLevel>()
|
||||||
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
override val coroutineScope: CoroutineScope = coreContext.coroutineScope
|
override val coroutineScope: CoroutineScope = coreContext.coroutineScope
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class ContactViewModelFactory(private val friend: Friend) :
|
||||||
class ContactViewModel(friend: Friend, async: Boolean = false) : MessageNotifierViewModel(), ContactDataInterface {
|
class ContactViewModel(friend: Friend, async: Boolean = false) : MessageNotifierViewModel(), ContactDataInterface {
|
||||||
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
override val securityLevel: MutableLiveData<ChatRoom.SecurityLevel> = MutableLiveData<ChatRoom.SecurityLevel>()
|
||||||
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
override val coroutineScope: CoroutineScope = viewModelScope
|
override val coroutineScope: CoroutineScope = viewModelScope
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ class ContactViewModel(friend: Friend, async: Boolean = false) : MessageNotifier
|
||||||
val hasLimeCapability = corePreferences.allowEndToEndEncryptedChatWithoutPresence || (
|
val hasLimeCapability = corePreferences.allowEndToEndEncryptedChatWithoutPresence || (
|
||||||
friend.getPresenceModelForUriOrTel(
|
friend.getPresenceModelForUriOrTel(
|
||||||
value
|
value
|
||||||
)?.hasCapability(FriendCapability.LimeX3Dh) ?: false
|
)?.hasCapability(Friend.Capability.LimeX3Dh) ?: false
|
||||||
)
|
)
|
||||||
val secureChatAllowed = LinphoneUtils.isEndToEndEncryptedChatAvailable() && !isMe && hasLimeCapability
|
val secureChatAllowed = LinphoneUtils.isEndToEndEncryptedChatAvailable() && !isMe && hasLimeCapability
|
||||||
val displayValue = if (coreContext.core.defaultAccount?.params?.domain == address.domain) (address.username ?: value) else value
|
val displayValue = if (coreContext.core.defaultAccount?.params?.domain == address.domain) (address.username ?: value) else value
|
||||||
|
@ -249,7 +249,7 @@ class ContactViewModel(friend: Friend, async: Boolean = false) : MessageNotifier
|
||||||
val hasLimeCapability = corePreferences.allowEndToEndEncryptedChatWithoutPresence || (
|
val hasLimeCapability = corePreferences.allowEndToEndEncryptedChatWithoutPresence || (
|
||||||
friend.getPresenceModelForUriOrTel(
|
friend.getPresenceModelForUriOrTel(
|
||||||
number
|
number
|
||||||
)?.hasCapability(FriendCapability.LimeX3Dh) ?: false
|
)?.hasCapability(Friend.Capability.LimeX3Dh) ?: false
|
||||||
)
|
)
|
||||||
val secureChatAllowed = LinphoneUtils.isEndToEndEncryptedChatAvailable() && !isMe && hasLimeCapability
|
val secureChatAllowed = LinphoneUtils.isEndToEndEncryptedChatAvailable() && !isMe && hasLimeCapability
|
||||||
val label = PhoneNumberUtils.vcardParamStringToAddressBookLabel(
|
val label = PhoneNumberUtils.vcardParamStringToAddressBookLabel(
|
||||||
|
|
|
@ -119,8 +119,8 @@ class ContactsListViewModel : ViewModel() {
|
||||||
previousFilter = filterValue
|
previousFilter = filterValue
|
||||||
|
|
||||||
val domain = if (sipContactsSelected.value == true) coreContext.core.defaultAccount?.params?.domain ?: "" else ""
|
val domain = if (sipContactsSelected.value == true) coreContext.core.defaultAccount?.params?.domain ?: "" else ""
|
||||||
val filter = MagicSearchSource.Friends.toInt() or MagicSearchSource.LdapServers.toInt()
|
val filter = MagicSearch.Source.Friends.toInt() or MagicSearch.Source.LdapServers.toInt()
|
||||||
val aggregation = MagicSearchAggregation.Friend
|
val aggregation = MagicSearch.Aggregation.Friend
|
||||||
searchResultsPending = true
|
searchResultsPending = true
|
||||||
fastFetchJob?.cancel()
|
fastFetchJob?.cancel()
|
||||||
Log.i(
|
Log.i(
|
||||||
|
|
|
@ -110,7 +110,7 @@ class CallLogViewModel(val callLog: CallLog, private val isRelated: Boolean = fa
|
||||||
corePreferences.allowEndToEndEncryptedChatWithoutPresence || (
|
corePreferences.allowEndToEndEncryptedChatWithoutPresence || (
|
||||||
contact.value?.getPresenceModelForUriOrTel(
|
contact.value?.getPresenceModelForUriOrTel(
|
||||||
peerSipUri
|
peerSipUri
|
||||||
)?.hasCapability(FriendCapability.LimeX3Dh) ?: false
|
)?.hasCapability(Friend.Capability.LimeX3Dh) ?: false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,12 @@ package org.linphone.activities.main.settings.viewmodels
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.activities.main.settings.SettingListenerStub
|
import org.linphone.activities.main.settings.SettingListenerStub
|
||||||
import org.linphone.core.ConferenceLayout
|
import org.linphone.core.Conference.Layout
|
||||||
|
|
||||||
class ConferencesSettingsViewModel : GenericSettingsViewModel() {
|
class ConferencesSettingsViewModel : GenericSettingsViewModel() {
|
||||||
val layoutListener = object : SettingListenerStub() {
|
val layoutListener = object : SettingListenerStub() {
|
||||||
override fun onListValueChanged(position: Int) {
|
override fun onListValueChanged(position: Int) {
|
||||||
core.defaultConferenceLayout = ConferenceLayout.fromInt(layoutValues[position])
|
core.defaultConferenceLayout = Layout.fromInt(layoutValues[position])
|
||||||
layoutIndex.value = position
|
layoutIndex.value = position
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,10 +43,10 @@ class ConferencesSettingsViewModel : GenericSettingsViewModel() {
|
||||||
val labels = arrayListOf<String>()
|
val labels = arrayListOf<String>()
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.conference_display_mode_active_speaker))
|
labels.add(prefs.getString(R.string.conference_display_mode_active_speaker))
|
||||||
layoutValues.add(ConferenceLayout.ActiveSpeaker.toInt())
|
layoutValues.add(Layout.ActiveSpeaker.toInt())
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.conference_display_mode_mosaic))
|
labels.add(prefs.getString(R.string.conference_display_mode_mosaic))
|
||||||
layoutValues.add(ConferenceLayout.Grid.toInt())
|
layoutValues.add(Layout.Grid.toInt())
|
||||||
|
|
||||||
layoutLabels.value = labels
|
layoutLabels.value = labels
|
||||||
layoutIndex.value = layoutValues.indexOf(core.defaultConferenceLayout.toInt())
|
layoutIndex.value = layoutValues.indexOf(core.defaultConferenceLayout.toInt())
|
||||||
|
|
|
@ -27,9 +27,6 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.activities.main.settings.SettingListenerStub
|
import org.linphone.activities.main.settings.SettingListenerStub
|
||||||
import org.linphone.core.Ldap
|
import org.linphone.core.Ldap
|
||||||
import org.linphone.core.LdapAuthMethod
|
|
||||||
import org.linphone.core.LdapCertVerificationMode
|
|
||||||
import org.linphone.core.LdapDebugLevel
|
|
||||||
import org.linphone.core.tools.Log
|
import org.linphone.core.tools.Log
|
||||||
import org.linphone.utils.Event
|
import org.linphone.utils.Event
|
||||||
|
|
||||||
|
@ -102,7 +99,7 @@ class LdapSettingsViewModel(private val ldap: Ldap, val index: String) : Generic
|
||||||
val ldapAuthMethodListener = object : SettingListenerStub() {
|
val ldapAuthMethodListener = object : SettingListenerStub() {
|
||||||
override fun onListValueChanged(position: Int) {
|
override fun onListValueChanged(position: Int) {
|
||||||
val params = ldap.params.clone()
|
val params = ldap.params.clone()
|
||||||
params.authMethod = LdapAuthMethod.fromInt(ldapAuthMethodValues[position])
|
params.authMethod = Ldap.AuthMethod.fromInt(ldapAuthMethodValues[position])
|
||||||
ldap.params = params
|
ldap.params = params
|
||||||
ldapAuthMethodIndex.value = position
|
ldapAuthMethodIndex.value = position
|
||||||
}
|
}
|
||||||
|
@ -123,7 +120,7 @@ class LdapSettingsViewModel(private val ldap: Ldap, val index: String) : Generic
|
||||||
val ldapCertCheckListener = object : SettingListenerStub() {
|
val ldapCertCheckListener = object : SettingListenerStub() {
|
||||||
override fun onListValueChanged(position: Int) {
|
override fun onListValueChanged(position: Int) {
|
||||||
val params = ldap.params.clone()
|
val params = ldap.params.clone()
|
||||||
params.serverCertificatesVerificationMode = LdapCertVerificationMode.fromInt(
|
params.serverCertificatesVerificationMode = Ldap.CertVerificationMode.fromInt(
|
||||||
ldapCertCheckValues[position]
|
ldapCertCheckValues[position]
|
||||||
)
|
)
|
||||||
ldap.params = params
|
ldap.params = params
|
||||||
|
@ -238,7 +235,7 @@ class LdapSettingsViewModel(private val ldap: Ldap, val index: String) : Generic
|
||||||
val ldapDebugListener = object : SettingListenerStub() {
|
val ldapDebugListener = object : SettingListenerStub() {
|
||||||
override fun onBoolValueChanged(newValue: Boolean) {
|
override fun onBoolValueChanged(newValue: Boolean) {
|
||||||
val params = ldap.params.clone()
|
val params = ldap.params.clone()
|
||||||
params.debugLevel = if (newValue) LdapDebugLevel.Verbose else LdapDebugLevel.Off
|
params.debugLevel = if (newValue) Ldap.DebugLevel.Verbose else Ldap.DebugLevel.Off
|
||||||
ldap.params = params
|
ldap.params = params
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +258,7 @@ class LdapSettingsViewModel(private val ldap: Ldap, val index: String) : Generic
|
||||||
ldapNameAttribute.value = params.nameAttribute
|
ldapNameAttribute.value = params.nameAttribute
|
||||||
ldapSipAttribute.value = params.sipAttribute
|
ldapSipAttribute.value = params.sipAttribute
|
||||||
ldapSipDomain.value = params.sipDomain
|
ldapSipDomain.value = params.sipDomain
|
||||||
ldapDebug.value = params.debugLevel == LdapDebugLevel.Verbose
|
ldapDebug.value = params.debugLevel == Ldap.DebugLevel.Verbose
|
||||||
|
|
||||||
initAuthMethodList()
|
initAuthMethodList()
|
||||||
initTlsCertCheckList()
|
initTlsCertCheckList()
|
||||||
|
@ -271,10 +268,10 @@ class LdapSettingsViewModel(private val ldap: Ldap, val index: String) : Generic
|
||||||
val labels = arrayListOf<String>()
|
val labels = arrayListOf<String>()
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.contacts_settings_ldap_auth_method_anonymous))
|
labels.add(prefs.getString(R.string.contacts_settings_ldap_auth_method_anonymous))
|
||||||
ldapAuthMethodValues.add(LdapAuthMethod.Anonymous.toInt())
|
ldapAuthMethodValues.add(Ldap.AuthMethod.Anonymous.toInt())
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.contacts_settings_ldap_auth_method_simple))
|
labels.add(prefs.getString(R.string.contacts_settings_ldap_auth_method_simple))
|
||||||
ldapAuthMethodValues.add(LdapAuthMethod.Simple.toInt())
|
ldapAuthMethodValues.add(Ldap.AuthMethod.Simple.toInt())
|
||||||
|
|
||||||
ldapAuthMethodLabels.value = labels
|
ldapAuthMethodLabels.value = labels
|
||||||
ldapAuthMethodIndex.value = ldapAuthMethodValues.indexOf(ldap.params.authMethod.toInt())
|
ldapAuthMethodIndex.value = ldapAuthMethodValues.indexOf(ldap.params.authMethod.toInt())
|
||||||
|
@ -284,13 +281,13 @@ class LdapSettingsViewModel(private val ldap: Ldap, val index: String) : Generic
|
||||||
val labels = arrayListOf<String>()
|
val labels = arrayListOf<String>()
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.contacts_settings_ldap_cert_check_auto))
|
labels.add(prefs.getString(R.string.contacts_settings_ldap_cert_check_auto))
|
||||||
ldapCertCheckValues.add(LdapCertVerificationMode.Default.toInt())
|
ldapCertCheckValues.add(Ldap.CertVerificationMode.Default.toInt())
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.contacts_settings_ldap_cert_check_disabled))
|
labels.add(prefs.getString(R.string.contacts_settings_ldap_cert_check_disabled))
|
||||||
ldapCertCheckValues.add(LdapCertVerificationMode.Disabled.toInt())
|
ldapCertCheckValues.add(Ldap.CertVerificationMode.Disabled.toInt())
|
||||||
|
|
||||||
labels.add(prefs.getString(R.string.contacts_settings_ldap_cert_check_enabled))
|
labels.add(prefs.getString(R.string.contacts_settings_ldap_cert_check_enabled))
|
||||||
ldapCertCheckValues.add(LdapCertVerificationMode.Enabled.toInt())
|
ldapCertCheckValues.add(Ldap.CertVerificationMode.Enabled.toInt())
|
||||||
|
|
||||||
ldapCertCheckLabels.value = labels
|
ldapCertCheckLabels.value = labels
|
||||||
ldapCertCheckIndex.value = ldapCertCheckValues.indexOf(
|
ldapCertCheckIndex.value = ldapCertCheckValues.indexOf(
|
||||||
|
|
|
@ -70,17 +70,17 @@ class ConferenceParticipantDeviceData(
|
||||||
|
|
||||||
override fun onStateChanged(
|
override fun onStateChanged(
|
||||||
participantDevice: ParticipantDevice,
|
participantDevice: ParticipantDevice,
|
||||||
state: ParticipantDeviceState
|
state: ParticipantDevice.State
|
||||||
) {
|
) {
|
||||||
Log.i(
|
Log.i(
|
||||||
"[Conference Participant Device] Participant [${participantDevice.address.asStringUriOnly()}] state has changed: $state"
|
"[Conference Participant Device] Participant [${participantDevice.address.asStringUriOnly()}] state has changed: $state"
|
||||||
)
|
)
|
||||||
when (state) {
|
when (state) {
|
||||||
ParticipantDeviceState.Joining, ParticipantDeviceState.Alerting -> isJoining.value = true
|
ParticipantDevice.State.Joining, ParticipantDevice.State.Alerting -> isJoining.value = true
|
||||||
ParticipantDeviceState.OnHold -> {
|
ParticipantDevice.State.OnHold -> {
|
||||||
isInConference.value = false
|
isInConference.value = false
|
||||||
}
|
}
|
||||||
ParticipantDeviceState.Present -> {
|
ParticipantDevice.State.Present -> {
|
||||||
isJoining.value = false
|
isJoining.value = false
|
||||||
isInConference.value = true
|
isInConference.value = true
|
||||||
updateWindowId(textureView)
|
updateWindowId(textureView)
|
||||||
|
@ -135,7 +135,7 @@ class ConferenceParticipantDeviceData(
|
||||||
isInConference.value = participantDevice.isInConference
|
isInConference.value = participantDevice.isInConference
|
||||||
|
|
||||||
val state = participantDevice.state
|
val state = participantDevice.state
|
||||||
isJoining.value = state == ParticipantDeviceState.Joining || state == ParticipantDeviceState.Alerting
|
isJoining.value = state == ParticipantDevice.State.Joining || state == ParticipantDevice.State.Alerting
|
||||||
Log.i(
|
Log.i(
|
||||||
"[Conference Participant Device] State for participant [${participantDevice.address.asStringUriOnly()}] is $state"
|
"[Conference Participant Device] State for participant [${participantDevice.address.asStringUriOnly()}] is $state"
|
||||||
)
|
)
|
||||||
|
|
|
@ -85,7 +85,7 @@ class StatItemData(val type: StatType) {
|
||||||
StatType.DOWNLOAD_BW -> "${stats.downloadBandwidth} kbits/s"
|
StatType.DOWNLOAD_BW -> "${stats.downloadBandwidth} kbits/s"
|
||||||
StatType.UPLOAD_BW -> "${stats.uploadBandwidth} kbits/s"
|
StatType.UPLOAD_BW -> "${stats.uploadBandwidth} kbits/s"
|
||||||
StatType.ICE -> stats.iceState.toString()
|
StatType.ICE -> stats.iceState.toString()
|
||||||
StatType.IP_FAM -> if (stats.ipFamilyOfRemote == AddressFamily.Inet6) "IPv6" else "IPv4"
|
StatType.IP_FAM -> if (stats.ipFamilyOfRemote == Address.Family.Inet6) "IPv6" else "IPv4"
|
||||||
StatType.SENDER_LOSS -> DecimalFormat("##.##%").format(stats.senderLossRate)
|
StatType.SENDER_LOSS -> DecimalFormat("##.##%").format(stats.senderLossRate)
|
||||||
StatType.RECEIVER_LOSS -> DecimalFormat("##.##%").format(stats.receiverLossRate)
|
StatType.RECEIVER_LOSS -> DecimalFormat("##.##%").format(stats.receiverLossRate)
|
||||||
StatType.JITTER -> DecimalFormat("##.## ms").format(stats.jitterBufferSizeMs)
|
StatType.JITTER -> DecimalFormat("##.## ms").format(stats.jitterBufferSizeMs)
|
||||||
|
|
|
@ -174,15 +174,15 @@ class ConferenceViewModel : ViewModel() {
|
||||||
override fun onParticipantDeviceStateChanged(
|
override fun onParticipantDeviceStateChanged(
|
||||||
conference: Conference,
|
conference: Conference,
|
||||||
device: ParticipantDevice,
|
device: ParticipantDevice,
|
||||||
state: ParticipantDeviceState
|
state: ParticipantDevice.State
|
||||||
) {
|
) {
|
||||||
if (conference.isMe(device.address)) {
|
if (conference.isMe(device.address)) {
|
||||||
when (state) {
|
when (state) {
|
||||||
ParticipantDeviceState.Present -> {
|
ParticipantDevice.State.Present -> {
|
||||||
Log.i("[Conference] Entered conference")
|
Log.i("[Conference] Entered conference")
|
||||||
isConferenceLocallyPaused.value = false
|
isConferenceLocallyPaused.value = false
|
||||||
}
|
}
|
||||||
ParticipantDeviceState.OnHold -> {
|
ParticipantDevice.State.OnHold -> {
|
||||||
Log.i("[Conference] Left conference")
|
Log.i("[Conference] Left conference")
|
||||||
isConferenceLocallyPaused.value = true
|
isConferenceLocallyPaused.value = true
|
||||||
}
|
}
|
||||||
|
@ -436,8 +436,8 @@ class ConferenceViewModel : ViewModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
params.conferenceVideoLayout = when (layout) {
|
params.conferenceVideoLayout = when (layout) {
|
||||||
ConferenceDisplayMode.GRID -> ConferenceLayout.Grid
|
ConferenceDisplayMode.GRID -> Conference.Layout.Grid
|
||||||
else -> ConferenceLayout.ActiveSpeaker
|
else -> Conference.Layout.ActiveSpeaker
|
||||||
}
|
}
|
||||||
call.update(params)
|
call.update(params)
|
||||||
|
|
||||||
|
@ -464,7 +464,7 @@ class ConferenceViewModel : ViewModel() {
|
||||||
ConferenceDisplayMode.AUDIO_ONLY
|
ConferenceDisplayMode.AUDIO_ONLY
|
||||||
} else {
|
} else {
|
||||||
when (params.conferenceVideoLayout) {
|
when (params.conferenceVideoLayout) {
|
||||||
ConferenceLayout.Grid -> ConferenceDisplayMode.GRID
|
Conference.Layout.Grid -> ConferenceDisplayMode.GRID
|
||||||
else -> ConferenceDisplayMode.ACTIVE_SPEAKER
|
else -> ConferenceDisplayMode.ACTIVE_SPEAKER
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import kotlinx.coroutines.CoroutineScope
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.activities.main.viewmodels.MessageNotifierViewModel
|
import org.linphone.activities.main.viewmodels.MessageNotifierViewModel
|
||||||
import org.linphone.core.Address
|
import org.linphone.core.Address
|
||||||
import org.linphone.core.ChatRoomSecurityLevel
|
import org.linphone.core.ChatRoom.SecurityLevel
|
||||||
import org.linphone.core.ConsolidatedPresence
|
import org.linphone.core.ConsolidatedPresence
|
||||||
import org.linphone.core.Friend
|
import org.linphone.core.Friend
|
||||||
import org.linphone.utils.LinphoneUtils
|
import org.linphone.utils.LinphoneUtils
|
||||||
|
@ -35,7 +35,7 @@ interface ContactDataInterface {
|
||||||
|
|
||||||
val displayName: MutableLiveData<String>
|
val displayName: MutableLiveData<String>
|
||||||
|
|
||||||
val securityLevel: MutableLiveData<ChatRoomSecurityLevel>
|
val securityLevel: MutableLiveData<SecurityLevel>
|
||||||
|
|
||||||
val showGroupChatAvatar: Boolean
|
val showGroupChatAvatar: Boolean
|
||||||
get() = false
|
get() = false
|
||||||
|
@ -48,12 +48,12 @@ interface ContactDataInterface {
|
||||||
open class GenericContactData(private val sipAddress: Address) : ContactDataInterface {
|
open class GenericContactData(private val sipAddress: Address) : ContactDataInterface {
|
||||||
final override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
final override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
final override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
final override val securityLevel: MutableLiveData<SecurityLevel> = MutableLiveData<SecurityLevel>()
|
||||||
final override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
final override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
final override val coroutineScope: CoroutineScope = coreContext.coroutineScope
|
final override val coroutineScope: CoroutineScope = coreContext.coroutineScope
|
||||||
|
|
||||||
init {
|
init {
|
||||||
securityLevel.value = ChatRoomSecurityLevel.ClearText
|
securityLevel.value = SecurityLevel.ClearText
|
||||||
presenceStatus.value = ConsolidatedPresence.Offline
|
presenceStatus.value = ConsolidatedPresence.Offline
|
||||||
contactLookup()
|
contactLookup()
|
||||||
}
|
}
|
||||||
|
@ -78,12 +78,12 @@ open class GenericContactData(private val sipAddress: Address) : ContactDataInte
|
||||||
abstract class GenericContactViewModel(private val sipAddress: Address) : MessageNotifierViewModel(), ContactDataInterface {
|
abstract class GenericContactViewModel(private val sipAddress: Address) : MessageNotifierViewModel(), ContactDataInterface {
|
||||||
final override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
final override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
final override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
final override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
final override val securityLevel: MutableLiveData<SecurityLevel> = MutableLiveData<SecurityLevel>()
|
||||||
final override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
final override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
final override val coroutineScope: CoroutineScope = viewModelScope
|
final override val coroutineScope: CoroutineScope = viewModelScope
|
||||||
|
|
||||||
init {
|
init {
|
||||||
securityLevel.value = ChatRoomSecurityLevel.ClearText
|
securityLevel.value = SecurityLevel.ClearText
|
||||||
presenceStatus.value = ConsolidatedPresence.Offline
|
presenceStatus.value = ConsolidatedPresence.Offline
|
||||||
contactLookup()
|
contactLookup()
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import org.linphone.utils.LinphoneUtils
|
||||||
class ContactSelectionData(private val searchResult: SearchResult) : ContactDataInterface {
|
class ContactSelectionData(private val searchResult: SearchResult) : ContactDataInterface {
|
||||||
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
override val contact: MutableLiveData<Friend> = MutableLiveData<Friend>()
|
||||||
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
override val displayName: MutableLiveData<String> = MutableLiveData<String>()
|
||||||
override val securityLevel: MutableLiveData<ChatRoomSecurityLevel> = MutableLiveData<ChatRoomSecurityLevel>()
|
override val securityLevel: MutableLiveData<ChatRoom.SecurityLevel> = MutableLiveData<ChatRoom.SecurityLevel>()
|
||||||
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
override val presenceStatus: MutableLiveData<ConsolidatedPresence> = MutableLiveData<ConsolidatedPresence>()
|
||||||
override val coroutineScope: CoroutineScope = coreContext.coroutineScope
|
override val coroutineScope: CoroutineScope = coreContext.coroutineScope
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class ContactSelectionData(private val searchResult: SearchResult) : ContactData
|
||||||
|
|
||||||
val hasLimeX3DHCapability: Boolean
|
val hasLimeX3DHCapability: Boolean
|
||||||
get() = LinphoneUtils.isEndToEndEncryptedChatAvailable() && searchResult.hasCapability(
|
get() = LinphoneUtils.isEndToEndEncryptedChatAvailable() && searchResult.hasCapability(
|
||||||
FriendCapability.LimeX3Dh
|
Friend.Capability.LimeX3Dh
|
||||||
)
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
@ -30,7 +30,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
import org.linphone.core.Address
|
import org.linphone.core.Address
|
||||||
import org.linphone.core.FriendCapability
|
import org.linphone.core.Friend.Capability
|
||||||
import org.linphone.core.SearchResult
|
import org.linphone.core.SearchResult
|
||||||
import org.linphone.databinding.ContactSelectionCellBinding
|
import org.linphone.databinding.ContactSelectionCellBinding
|
||||||
import org.linphone.utils.Event
|
import org.linphone.utils.Event
|
||||||
|
@ -121,12 +121,12 @@ class ContactsSelectionAdapter(
|
||||||
) ?: false
|
) ?: false
|
||||||
val limeCheck = !securityEnabled || (
|
val limeCheck = !securityEnabled || (
|
||||||
securityEnabled && searchResult.hasCapability(
|
securityEnabled && searchResult.hasCapability(
|
||||||
FriendCapability.LimeX3Dh
|
Capability.LimeX3Dh
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val groupCheck = !groupCapabilityRequired || (
|
val groupCheck = !groupCapabilityRequired || (
|
||||||
groupCapabilityRequired && searchResult.hasCapability(
|
groupCapabilityRequired && searchResult.hasCapability(
|
||||||
FriendCapability.GroupChat
|
Capability.GroupChat
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val disabled = if (searchResult.friend != null) !limeCheck || !groupCheck || isMyself else false // Generated entry from search filter
|
val disabled = if (searchResult.friend != null) !limeCheck || !groupCheck || isMyself else false // Generated entry from search filter
|
||||||
|
|
|
@ -100,8 +100,8 @@ open class ContactsSelectionViewModel : MessageNotifierViewModel() {
|
||||||
coreContext.contactsManager.magicSearch.getContactsListAsync(
|
coreContext.contactsManager.magicSearch.getContactsListAsync(
|
||||||
filterValue,
|
filterValue,
|
||||||
domain,
|
domain,
|
||||||
MagicSearchSource.All.toInt(),
|
MagicSearch.Source.All.toInt(),
|
||||||
MagicSearchAggregation.None
|
MagicSearch.Aggregation.None
|
||||||
)
|
)
|
||||||
|
|
||||||
val spinnerDelay = corePreferences.delayBeforeShowingContactsSearchSpinner.toLong()
|
val spinnerDelay = corePreferences.delayBeforeShowingContactsSearchSpinner.toLong()
|
||||||
|
|
|
@ -792,7 +792,7 @@ class NotificationsManager(private val context: Context) {
|
||||||
notifiable.messages.add(notifiableMessage)
|
notifiable.messages.add(notifiableMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.hasCapability(ChatRoomCapabilities.OneToOne.toInt())) {
|
if (room.hasCapability(ChatRoom.Capabilities.OneToOne.toInt())) {
|
||||||
notifiable.isGroup = false
|
notifiable.isGroup = false
|
||||||
} else {
|
} else {
|
||||||
notifiable.isGroup = true
|
notifiable.isGroup = true
|
||||||
|
|
|
@ -133,11 +133,11 @@ class LinphoneUtils {
|
||||||
|
|
||||||
val params = core.createDefaultChatRoomParams()
|
val params = core.createDefaultChatRoomParams()
|
||||||
params.isGroupEnabled = false
|
params.isGroupEnabled = false
|
||||||
params.backend = ChatRoomBackend.Basic
|
params.backend = ChatRoom.Backend.Basic
|
||||||
if (isSecured) {
|
if (isSecured) {
|
||||||
params.subject = AppUtils.getString(R.string.chat_room_dummy_subject)
|
params.subject = AppUtils.getString(R.string.chat_room_dummy_subject)
|
||||||
params.isEncryptionEnabled = true
|
params.isEncryptionEnabled = true
|
||||||
params.backend = ChatRoomBackend.FlexisipChat
|
params.backend = ChatRoom.Backend.FlexisipChat
|
||||||
}
|
}
|
||||||
|
|
||||||
val participants = arrayOf(participant)
|
val participants = arrayOf(participant)
|
||||||
|
@ -159,10 +159,10 @@ class LinphoneUtils {
|
||||||
val chatRoomParams = coreContext.core.createDefaultChatRoomParams()
|
val chatRoomParams = coreContext.core.createDefaultChatRoomParams()
|
||||||
chatRoomParams.isGroupEnabled = false
|
chatRoomParams.isGroupEnabled = false
|
||||||
if (isEndToEndEncryptedChatAvailable()) {
|
if (isEndToEndEncryptedChatAvailable()) {
|
||||||
chatRoomParams.backend = ChatRoomBackend.FlexisipChat
|
chatRoomParams.backend = ChatRoom.Backend.FlexisipChat
|
||||||
chatRoomParams.isEncryptionEnabled = true
|
chatRoomParams.isEncryptionEnabled = true
|
||||||
} else {
|
} else {
|
||||||
chatRoomParams.backend = ChatRoomBackend.Basic
|
chatRoomParams.backend = ChatRoom.Backend.Basic
|
||||||
chatRoomParams.isEncryptionEnabled = false
|
chatRoomParams.isEncryptionEnabled = false
|
||||||
}
|
}
|
||||||
chatRoomParams.subject = "Meeting invitation" // Won't be used
|
chatRoomParams.subject = "Meeting invitation" // Won't be used
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.linphone.activities.main.MainActivity
|
||||||
import org.linphone.contact.getPerson
|
import org.linphone.contact.getPerson
|
||||||
import org.linphone.core.Address
|
import org.linphone.core.Address
|
||||||
import org.linphone.core.ChatRoom
|
import org.linphone.core.ChatRoom
|
||||||
import org.linphone.core.ChatRoomCapabilities
|
import org.linphone.core.ChatRoom.Capabilities
|
||||||
import org.linphone.core.Friend
|
import org.linphone.core.Friend
|
||||||
import org.linphone.core.tools.Log
|
import org.linphone.core.tools.Log
|
||||||
import org.linphone.mediastream.Version
|
import org.linphone.mediastream.Version
|
||||||
|
@ -62,7 +62,7 @@ class ShortcutsHelper(val context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
val addresses: ArrayList<Address> = arrayListOf(room.peerAddress)
|
val addresses: ArrayList<Address> = arrayListOf(room.peerAddress)
|
||||||
if (!room.hasCapability(ChatRoomCapabilities.Basic.toInt())) {
|
if (!room.hasCapability(Capabilities.Basic.toInt())) {
|
||||||
addresses.clear()
|
addresses.clear()
|
||||||
for (participant in room.participants) {
|
for (participant in room.participants) {
|
||||||
addresses.add(participant.address)
|
addresses.add(participant.address)
|
||||||
|
@ -169,7 +169,7 @@ class ShortcutsHelper(val context: Context) {
|
||||||
val personsList = arrayListOf<Person>()
|
val personsList = arrayListOf<Person>()
|
||||||
val subject: String
|
val subject: String
|
||||||
val icon: IconCompat
|
val icon: IconCompat
|
||||||
if (chatRoom.hasCapability(ChatRoomCapabilities.Basic.toInt())) {
|
if (chatRoom.hasCapability(Capabilities.Basic.toInt())) {
|
||||||
val contact =
|
val contact =
|
||||||
coreContext.contactsManager.findContactByAddress(chatRoom.peerAddress)
|
coreContext.contactsManager.findContactByAddress(chatRoom.peerAddress)
|
||||||
val person = contact?.getPerson()
|
val person = contact?.getPerson()
|
||||||
|
@ -179,7 +179,7 @@ class ShortcutsHelper(val context: Context) {
|
||||||
|
|
||||||
icon = person?.icon ?: coreContext.contactsManager.contactAvatar
|
icon = person?.icon ?: coreContext.contactsManager.contactAvatar
|
||||||
subject = contact?.name ?: LinphoneUtils.getDisplayName(chatRoom.peerAddress)
|
subject = contact?.name ?: LinphoneUtils.getDisplayName(chatRoom.peerAddress)
|
||||||
} else if (chatRoom.hasCapability(ChatRoomCapabilities.OneToOne.toInt()) && chatRoom.participants.isNotEmpty()) {
|
} else if (chatRoom.hasCapability(Capabilities.OneToOne.toInt()) && chatRoom.participants.isNotEmpty()) {
|
||||||
val address = chatRoom.participants.first().address
|
val address = chatRoom.participants.first().address
|
||||||
val contact =
|
val contact =
|
||||||
coreContext.contactsManager.findContactByAddress(address)
|
coreContext.contactsManager.findContactByAddress(address)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
<import type="org.linphone.core.ChatRoomSecurityLevel"/>
|
<import type="org.linphone.core.ChatRoom.SecurityLevel"/>
|
||||||
<import type="org.linphone.core.ConsolidatedPresence"/>
|
<import type="org.linphone.core.ConsolidatedPresence"/>
|
||||||
<variable
|
<variable
|
||||||
name="removeClickListener"
|
name="removeClickListener"
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:contentDescription="@string/content_description_contact_can_do_encryption"
|
android:contentDescription="@string/content_description_contact_can_do_encryption"
|
||||||
android:src="@drawable/security_toggle_icon_green"
|
android:src="@drawable/security_toggle_icon_green"
|
||||||
android:visibility="@{isEncrypted && data.securityLevel == ChatRoomSecurityLevel.ClearText ? View.VISIBLE : View.GONE, default=gone}" />
|
android:visibility="@{isEncrypted && data.securityLevel == SecurityLevel.ClearText ? View.VISIBLE : View.GONE, default=gone}" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:contentDescription="@{data.securityLevelContentDescription}"
|
android:contentDescription="@{data.securityLevelContentDescription}"
|
||||||
android:src="@{data.securityLevelIcon, default=@drawable/security_alert_indicator}"
|
android:src="@{data.securityLevelIcon, default=@drawable/security_alert_indicator}"
|
||||||
android:visibility="@{isEncrypted && data.securityLevel != ChatRoomSecurityLevel.ClearText ? View.VISIBLE : View.GONE, default=gone}" />
|
android:visibility="@{isEncrypted && data.securityLevel != SecurityLevel.ClearText ? View.VISIBLE : View.GONE, default=gone}" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue