Don't allow incoming messages if blocked via SIA

This commit is contained in:
Moez Bhatti
2018-04-06 00:57:43 -04:00
parent 160d045730
commit 927d07e72e
3 changed files with 17 additions and 6 deletions
@@ -60,7 +60,6 @@ class MessageRepositoryImpl @Inject constructor(
private val messageIds: KeyManager,
private val cursorToConversation: CursorToConversation,
private val cursorToRecipient: CursorToRecipient,
private val externalBlockingManager: ExternalBlockingManager,
private val prefs: Preferences) : MessageRepository {
override fun getConversations(archived: Boolean): Flowable<List<Conversation>> {
@@ -625,11 +624,6 @@ class MessageRepositoryImpl @Inject constructor(
}
}
// If any of the addresses here should be blocked, then block the conversation
conversation.blocked = recipients.map { it.address }.any { address ->
externalBlockingManager.shouldBlock(address).blockingGet()
}
conversation.recipients.clear()
conversation.recipients.addAll(recipients)
conversation.insertOrUpdate()