Conversation as field in Message

This commit is contained in:
Moez Bhatti
2018-03-27 17:19:07 -04:00
parent dd8fd3216d
commit 9c7ff3e6ea
16 changed files with 110 additions and 130 deletions
@@ -43,7 +43,7 @@ class ReceiveSms @Inject constructor(
messageRepo.insertReceivedSms(address, body, time) // Add the message to the db
}
.mapNotNull { message -> messageRepo.getOrCreateConversation(message.threadId) } // Map message to conversation
.mapNotNull { message -> message.conversation } // Map message to conversation
.filter { conversation -> !conversation.blocked } // Don't notify for blocked conversations
.doOnNext { conversation -> if (conversation.archived) messageRepo.markUnarchived(conversation.id) } // Unarchive conversation if necessary
.doOnNext { conversation -> notificationManager.update(conversation.id) } // Update the notification