Fixes related to chat rooms
This commit is contained in:
parent
6f5c83026a
commit
adffb08cd0
7 changed files with 14 additions and 9 deletions
|
@ -306,7 +306,7 @@ class MainActivity : GenericActivity(), SnackBarActivity, NavController.OnDestin
|
|||
|
||||
val peerAddress = coreContext.core.interpretUrl(addressToIM)?.asStringUriOnly()
|
||||
val localAddress =
|
||||
coreContext.core.defaultProxyConfig?.identityAddress?.asStringUriOnly()
|
||||
coreContext.core.defaultProxyConfig?.contact?.asStringUriOnly()
|
||||
val deepLink = "linphone-android://chat-room/$localAddress/$peerAddress"
|
||||
Log.i("[Main Activity] Starting deep link: $deepLink")
|
||||
findNavController(R.id.nav_host_fragment).navigate(Uri.parse(deepLink))
|
||||
|
|
|
@ -202,7 +202,7 @@ class MasterChatRoomsFragment : MasterFragment() {
|
|||
arguments?.clear()
|
||||
val localAddress = Factory.instance().createAddress(localSipUri)
|
||||
val remoteSipAddress = Factory.instance().createAddress(remoteSipUri)
|
||||
val chatRoom = coreContext.core.searchChatRoom(null, localAddress, arrayOf(remoteSipAddress))
|
||||
val chatRoom = coreContext.core.searchChatRoom(null, localAddress, remoteSipAddress, arrayOfNulls(0))
|
||||
if (chatRoom != null) {
|
||||
Log.i("[Chat] Found matching chat room $chatRoom")
|
||||
chatRoom.markAsRead()
|
||||
|
|
|
@ -168,7 +168,7 @@ class ChatRoomCreationViewModel : ErrorReportingViewModel() {
|
|||
val participants = arrayOf(searchResult.address)
|
||||
|
||||
// Use proxy config contact instead of identity because we need GRUU if FlexisipChat backend
|
||||
room = coreContext.core.searchChatRoom(params, defaultProxyConfig.contact, participants)
|
||||
room = coreContext.core.searchChatRoom(params, defaultProxyConfig.contact, null, participants)
|
||||
if (room == null) {
|
||||
Log.w("[Chat Room Creation] Couldn't find existing 1-1 chat room with remote ${searchResult.address.asStringUriOnly()}, encryption=$encrypted and local identity ${defaultProxyConfig.contact.asStringUriOnly()}")
|
||||
// Use proxy config contact instead of identity because we need GRUU if FlexisipChat backend
|
||||
|
|
|
@ -111,6 +111,7 @@ class ContactViewModel(private val c: Contact) : ErrorReportingViewModel(), Cont
|
|||
} else {
|
||||
waitForChatRoomCreation.value = false
|
||||
Log.e("[Contact Detail] Couldn't create chat room with address $address")
|
||||
onErrorEvent.value = Event(R.string.chat_room_creation_failed_snack)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,6 +142,7 @@ class CallLogViewModel(val callLog: CallLog) : GenericContactViewModel(callLog.r
|
|||
} else {
|
||||
waitForChatRoomCreation.value = false
|
||||
Log.e("[History Detail] Couldn't create chat room with address ${callLog.remoteAddress}")
|
||||
onErrorEvent.value = Event(R.string.chat_room_creation_failed_snack)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||
return
|
||||
}
|
||||
|
||||
val room = core.searchChatRoom(null, localAddress, arrayOf(remoteAddress))
|
||||
val room = core.searchChatRoom(null, localAddress, remoteAddress, arrayOfNulls(0))
|
||||
if (room == null) {
|
||||
Log.e("[Notification Broadcast Receiver] Couldn't find chat room for remote address $remoteSipAddress and local address $localIdentity")
|
||||
return
|
||||
|
|
|
@ -55,15 +55,18 @@ class LinphoneUtils {
|
|||
val defaultProxyConfig = core.defaultProxyConfig
|
||||
|
||||
val params = core.createDefaultChatRoomParams()
|
||||
params.enableEncryption(isSecured)
|
||||
params.enableGroup(false)
|
||||
params.backend = if (isSecured) ChatRoomBackend.FlexisipChat else ChatRoomBackend.Basic
|
||||
params.subject = AppUtils.getString(R.string.chat_room_dummy_subject)
|
||||
params.backend = ChatRoomBackend.Basic
|
||||
if (isSecured) {
|
||||
params.subject = AppUtils.getString(R.string.chat_room_dummy_subject)
|
||||
params.enableEncryption(true)
|
||||
params.backend = ChatRoomBackend.FlexisipChat
|
||||
}
|
||||
|
||||
val participants = arrayOf(participant)
|
||||
|
||||
return core.searchChatRoom(params, defaultProxyConfig?.identityAddress, participants)
|
||||
?: core.createChatRoom(params, defaultProxyConfig?.identityAddress, participants)
|
||||
return core.searchChatRoom(params, defaultProxyConfig?.contact, null, participants)
|
||||
?: core.createChatRoom(params, defaultProxyConfig?.contact, participants)
|
||||
}
|
||||
|
||||
fun deleteFilesAttachedToEventLog(eventLog: EventLog) {
|
||||
|
|
Loading…
Reference in a new issue