Add notification profile id for backupsv2.

This commit is contained in:
Cody Henthorne
2025-04-21 16:43:19 -04:00
parent b4a9189068
commit 4304ae2a96
21 changed files with 114 additions and 10 deletions

View File

@@ -12,7 +12,8 @@ data class NotificationProfile(
val allowAllCalls: Boolean = true,
val allowAllMentions: Boolean = false,
val schedule: NotificationProfileSchedule,
val allowedMembers: Set<RecipientId> = emptySet()
val allowedMembers: Set<RecipientId> = emptySet(),
val notificationProfileId: NotificationProfileId
) : Comparable<NotificationProfile> {
fun isRecipientAllowed(id: RecipientId): Boolean {

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2025 Signal Messenger, LLC
* SPDX-License-Identifier: AGPL-3.0-only
*/
package org.thoughtcrime.securesms.notifications.profiles
import org.signal.core.util.DatabaseId
import org.whispersystems.signalservice.api.util.UuidUtil
import java.util.UUID
/**
* Typed wrapper for notification profile uuid.
*/
data class NotificationProfileId(val uuid: UUID) : DatabaseId {
companion object {
fun from(id: String): NotificationProfileId {
return NotificationProfileId(UuidUtil.parseOrThrow(id))
}
fun generate(): NotificationProfileId {
return NotificationProfileId(UUID.randomUUID())
}
}
override fun serialize(): String {
return uuid.toString()
}
}