Add notification profiles to storage service.

This commit is contained in:
Michelle Tang
2025-06-04 11:02:43 -04:00
committed by Cody Henthorne
parent 07d961fc09
commit e3ee3d3dba
27 changed files with 1132 additions and 152 deletions

View File

@@ -2,20 +2,28 @@ package org.thoughtcrime.securesms.notifications.profiles
import org.thoughtcrime.securesms.conversation.colors.AvatarColor
import org.thoughtcrime.securesms.recipients.RecipientId
import org.whispersystems.signalservice.api.storage.StorageId
data class NotificationProfile(
val id: Long,
val name: String,
val emoji: String,
val color: AvatarColor = AvatarColor.A210,
val color: AvatarColor = DEFAULT_NOTIFICATION_PROFILE_COLOR,
val createdAt: Long,
val allowAllCalls: Boolean = true,
val allowAllMentions: Boolean = false,
val schedule: NotificationProfileSchedule,
val allowedMembers: Set<RecipientId> = emptySet(),
val notificationProfileId: NotificationProfileId
val notificationProfileId: NotificationProfileId,
val deletedTimestampMs: Long = 0,
val storageServiceId: StorageId? = null,
val storageServiceProto: ByteArray? = null
) : Comparable<NotificationProfile> {
companion object {
val DEFAULT_NOTIFICATION_PROFILE_COLOR = AvatarColor.A210
}
fun isRecipientAllowed(id: RecipientId): Boolean {
return allowedMembers.contains(id)
}