refactor: remove test logs

This commit is contained in:
jubb 2021-05-27 11:05:47 +10:00
parent 6fd1a82bed
commit e389044f25

View File

@ -143,17 +143,12 @@ class LokiMessageDatabase(context: Context, helper: SQLCipherOpenHelper) : Datab
messages.add(cursor.getLong(Companion.messageID) to cursor.getLong(Companion.serverID))
}
}
Log.d("Test", "Need to delete ${messages.size} number of messages")
var deletedCount = 0L
database.beginTransaction()
messages.forEach { (messageId, serverId) ->
deletedCount += database.delete(messageIDTable, "${Companion.messageID} = ? AND ${Companion.serverID} = ?", arrayOf(messageId.toString(), serverId.toString()))
}
Log.d("Test", "Deleted $deletedCount from messageIDTable")
val mappingDeleted = database.delete(messageThreadMappingTable, "${Companion.threadID} = ?", arrayOf(threadId.toString()))
Log.d("Test", "Deleted $mappingDeleted from mapping table")
database.setTransactionSuccessful()
} finally {
database.endTransaction()