forked from upstream-mirrors/quik
#824 - Ask user to set QK as default SMS app if they attempt something that requires it
This commit is contained in:
@@ -356,6 +356,7 @@ class ComposeViewModel @Inject constructor(
|
||||
// Delete the messages
|
||||
view.optionsItemIntent
|
||||
.filter { it == R.id.delete }
|
||||
.filter { permissionManager.isDefaultSms().also { if (!it) navigator.showDefaultSmsDialog() } }
|
||||
.withLatestFrom(view.messagesSelectedIntent, conversation) { _, messages, conversation ->
|
||||
deleteMessages.execute(DeleteMessages.Params(messages, conversation.id))
|
||||
}
|
||||
@@ -612,11 +613,8 @@ class ComposeViewModel @Inject constructor(
|
||||
|
||||
// Send a message when the send button is clicked, and disable editing mode if it's enabled
|
||||
view.sendIntent
|
||||
.filter {
|
||||
val hasPermission = permissionManager.hasSendSms()
|
||||
if (!hasPermission) view.requestSmsPermission()
|
||||
hasPermission
|
||||
}
|
||||
.filter { permissionManager.isDefaultSms().also { if (!it) navigator.showDefaultSmsDialog() } }
|
||||
.filter { permissionManager.hasSendSms().also { if (!it) view.requestSmsPermission() } }
|
||||
.withLatestFrom(view.textChangedIntent) { _, body -> body }
|
||||
.map { body -> body.toString() }
|
||||
.withLatestFrom(state, attachments, conversation, selectedContacts) { body, state, attachments, conversation, contacts ->
|
||||
|
||||
Reference in New Issue
Block a user