File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
session/libsession/avatars
thoughtcrime/securesms/database Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class AvatarCacheCleaner @Inject constructor(
31
31
* Deletes avatar files under cache/remote_files that are no longer referenced
32
32
* in the current config. Returns number of files deleted.
33
33
*/
34
- suspend fun cleanUpAvatars (): Int = withContext(Dispatchers .IO ) {
34
+ private suspend fun cleanUpAvatars (): Int = withContext(Dispatchers .IO ) {
35
35
// 1) Build the set of still-wanted Avatars from:
36
36
// -> Config
37
37
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ class RecipientSettingsDatabase @Inject constructor(
177
177
178
178
fun getAllRecipientAddresses (): Set <Address > {
179
179
return readableDatabase.rawQuery(
180
- " SELECT $COL_ADDRESS FROM $TABLE_NAME " , emptyArray()
180
+ " SELECT $COL_ADDRESS FROM $TABLE_NAME "
181
181
).use { cursor ->
182
182
buildSet {
183
183
while (cursor.moveToNext()) {
@@ -195,12 +195,9 @@ class RecipientSettingsDatabase @Inject constructor(
195
195
fun cleanupRecipientSettings (addressesToKeep : Set <Address >): Int {
196
196
if (addressesToKeep.isEmpty()) return 0
197
197
198
- // Build a temporary lookup of strings
199
- val keepSet = addressesToKeep.mapTo(hashSetOf()) { it.toString() }
200
-
201
198
// Collect all rows, figure out orphans in memory
202
199
val allRecipientAddresses = getAllRecipientAddresses()
203
- val orphans = allRecipientAddresses.filter { it.toString() !in keepSet }
200
+ val orphans = allRecipientAddresses.filter { it !in addressesToKeep }
204
201
205
202
if (orphans.isEmpty()) return 0
206
203
@@ -216,7 +213,6 @@ class RecipientSettingsDatabase @Inject constructor(
216
213
)
217
214
if (rows > 0 ) {
218
215
cache.remove(address)
219
- mutableChangeNotification.tryEmit(address)
220
216
deleted + = rows
221
217
}
222
218
}
You can’t perform that action at this time.
0 commit comments