mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-14 23:18:43 +00:00
Fetch abandoned attachment files in a transaction.
Not likely to affect anything because of the existin protected file system, more just a defense-and-depth style thing.
This commit is contained in:
committed by
Michelle Tang
parent
c727f93534
commit
6a423cb18b
@@ -1448,14 +1448,15 @@ class AttachmentTable(
|
||||
|
||||
val filesInDb: MutableSet<String> = HashSet(filesOnDisk.size)
|
||||
|
||||
readableDatabase
|
||||
.select(DATA_FILE, THUMBNAIL_FILE)
|
||||
.from(TABLE_NAME)
|
||||
.run()
|
||||
.forEach { cursor ->
|
||||
cursor.requireString(DATA_FILE)?.let { filesInDb += it }
|
||||
cursor.requireString(THUMBNAIL_FILE)?.let { filesInDb += it }
|
||||
}
|
||||
readableDatabase.withinTransaction { db ->
|
||||
db.select(DATA_FILE, THUMBNAIL_FILE)
|
||||
.from(TABLE_NAME)
|
||||
.run()
|
||||
.forEach { cursor ->
|
||||
cursor.requireString(DATA_FILE)?.let { filesInDb += it }
|
||||
cursor.requireString(THUMBNAIL_FILE)?.let { filesInDb += it }
|
||||
}
|
||||
}
|
||||
|
||||
filesInDb += SignalDatabase.stickers.getAllStickerFiles()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user