mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 03:28:52 +01:00
#874 - Multi selection for conversations
This commit is contained in:
@@ -25,7 +25,7 @@ import com.uber.autodispose.kotlin.autoDisposable
|
||||
import common.Navigator
|
||||
import common.base.QkViewModel
|
||||
import injection.appComponent
|
||||
import interactor.DeleteConversation
|
||||
import interactor.DeleteConversations
|
||||
import interactor.MarkArchived
|
||||
import interactor.MarkBlocked
|
||||
import interactor.MarkUnarchived
|
||||
@@ -48,7 +48,7 @@ class ConversationInfoViewModel(intent: Intent) : QkViewModel<ConversationInfoVi
|
||||
@Inject lateinit var markBlocked: MarkBlocked
|
||||
@Inject lateinit var markUnblocked: MarkUnblocked
|
||||
@Inject lateinit var navigator: Navigator
|
||||
@Inject lateinit var deleteConversation: DeleteConversation
|
||||
@Inject lateinit var deleteConversations: DeleteConversations
|
||||
|
||||
private val conversation: Observable<Conversation>
|
||||
|
||||
@@ -76,7 +76,7 @@ class ConversationInfoViewModel(intent: Intent) : QkViewModel<ConversationInfoVi
|
||||
disposables += markUnarchived
|
||||
disposables += markBlocked
|
||||
disposables += markUnblocked
|
||||
disposables += deleteConversation
|
||||
disposables += deleteConversations
|
||||
|
||||
// Update the recipients whenever they change
|
||||
disposables += conversation
|
||||
@@ -118,8 +118,8 @@ class ConversationInfoViewModel(intent: Intent) : QkViewModel<ConversationInfoVi
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { conversation ->
|
||||
when (conversation.archived) {
|
||||
true -> markUnarchived.execute(conversation.id)
|
||||
false -> markArchived.execute(conversation.id)
|
||||
true -> markUnarchived.execute(listOf(conversation.id))
|
||||
false -> markArchived.execute(listOf(conversation.id))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,8 +129,8 @@ class ConversationInfoViewModel(intent: Intent) : QkViewModel<ConversationInfoVi
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { conversation ->
|
||||
when (conversation.blocked) {
|
||||
true -> markUnblocked.execute(conversation.id)
|
||||
false -> markBlocked.execute(conversation.id)
|
||||
true -> markUnblocked.execute(listOf(conversation.id))
|
||||
false -> markBlocked.execute(listOf(conversation.id))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ class ConversationInfoViewModel(intent: Intent) : QkViewModel<ConversationInfoVi
|
||||
view.confirmDeleteIntent
|
||||
.withLatestFrom(conversation, { _, conversation -> conversation })
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { conversation -> deleteConversation.execute(conversation.id) }
|
||||
.subscribe { conversation -> deleteConversations.execute(listOf(conversation.id)) }
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user