forked from upstream-mirrors/quik
change to start dial of last non-me recipient in a conversation in compose, qkreply and main-activity-swipe call actions
This commit is contained in:
@@ -359,12 +359,14 @@ class ComposeViewModel @Inject constructor(
|
||||
|
||||
// Open the phone dialer if the call button is clicked
|
||||
view.optionsItemIntent
|
||||
.filter { it == R.id.call }
|
||||
.withLatestFrom(conversation) { _, conversation -> conversation }
|
||||
.mapNotNull { conversation -> conversation.recipients.firstOrNull() }
|
||||
.map { recipient -> recipient.address }
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { address -> navigator.makePhoneCall(address) }
|
||||
.filter { it == R.id.call }
|
||||
.withLatestFrom(state, conversation)
|
||||
.mapNotNull { (_, state, conversation) ->
|
||||
state.messages?.second?.lastOrNull { !it.isMe() }?.address // most recent non-me msg address
|
||||
?: conversation.recipients.firstOrNull()?.address // first recipient in convo
|
||||
}
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { navigator.makePhoneCall(it) }
|
||||
|
||||
// Open the conversation settings if info button is clicked
|
||||
view.optionsItemIntent
|
||||
|
||||
Reference in New Issue
Block a user