Update for core changes

This commit is contained in:
Niels Andriesse 2019-08-26 13:24:49 +10:00
parent 3f24f8753a
commit c5e4a2255c

View File

@ -77,9 +77,9 @@ class LokiGroupChatPoller(private val context: Context, private val groupID: Lon
} }
private fun pollForDeletedMessages() { private fun pollForDeletedMessages() {
api.getMessages(groupID, 0).success { messages -> api.getDeletedMessageIDs(groupID, 0).success { deletedMessageServerIDs ->
val lokiMessageDatabase = DatabaseFactory.getLokiMessageDatabase(context) val lokiMessageDatabase = DatabaseFactory.getLokiMessageDatabase(context)
val deletedMessageIDs = messages.filter { it.isDeleted }.mapNotNull { it.serverID }.mapNotNull { lokiMessageDatabase.getMessageID(it) } val deletedMessageIDs = deletedMessageServerIDs.mapNotNull { lokiMessageDatabase.getMessageID(it) }
val smsMessageDatabase = DatabaseFactory.getSmsDatabase(context) val smsMessageDatabase = DatabaseFactory.getSmsDatabase(context)
val mmsMessageDatabase = DatabaseFactory.getMmsDatabase(context) val mmsMessageDatabase = DatabaseFactory.getMmsDatabase(context)
deletedMessageIDs.forEach { deletedMessageIDs.forEach {