Fix notification profile export.

This commit is contained in:
Greyson Parrelli
2025-11-05 16:41:16 -05:00
committed by Michelle Tang
parent 366badbe92
commit 5d5c8803bd
2 changed files with 4 additions and 3 deletions

View File

@@ -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()

View File

@@ -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)
}
}