mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Fix notification profile export.
This commit is contained in:
committed by
Michelle Tang
parent
366badbe92
commit
5d5c8803bd
@@ -958,9 +958,9 @@ object BackupRepository {
|
||||
val signalStoreSnapshot: SignalStore = createSignalStoreSnapshot(keyValueDbName)
|
||||
eventTimer.emit("store-db-snapshot")
|
||||
|
||||
val exportState = ExportState(backupTime = currentTime, forTransfer = forTransfer)
|
||||
val selfAci = signalStoreSnapshot.accountValues.aci!!
|
||||
val selfRecipientId = dbSnapshot.recipientTable.getByAci(selfAci).get().toLong().let { RecipientId.from(it) }
|
||||
val exportState = ExportState(backupTime = currentTime, forTransfer = forTransfer, selfRecipientId = selfRecipientId)
|
||||
|
||||
var frameCount = 0L
|
||||
|
||||
@@ -2446,7 +2446,8 @@ data class ArchivedMediaObject(val mediaId: String, val cdn: Int)
|
||||
|
||||
class ExportState(
|
||||
val backupTime: Long,
|
||||
val forTransfer: Boolean
|
||||
val forTransfer: Boolean,
|
||||
val selfRecipientId: RecipientId
|
||||
) {
|
||||
val recipientIds: MutableSet<Long> = hashSetOf()
|
||||
val threadIds: MutableSet<Long> = hashSetOf()
|
||||
|
||||
@@ -39,7 +39,7 @@ object NotificationProfileArchiveProcessor {
|
||||
db.notificationProfileTables
|
||||
.getProfiles()
|
||||
.forEach { profile ->
|
||||
val frame = profile.toBackupFrame(includeRecipient = { id -> exportState.recipientIds.contains(id.toLong()) })
|
||||
val frame = profile.toBackupFrame(includeRecipient = { id -> exportState.recipientIds.contains(id.toLong()) && id != exportState.selfRecipientId })
|
||||
emitter.emit(frame)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user