Add StickerPackId and StickerPackKey value classes.

This commit is contained in:
Jeffrey Starke
2025-04-22 11:43:45 -04:00
committed by Cody Henthorne
parent 3779dfd290
commit 3fc386d4a3
6 changed files with 64 additions and 41 deletions

View File

@@ -252,10 +252,10 @@ class StickerTable(
notifyStickerPackListeners()
}
fun markPackAsInstalled(packKey: String, notify: Boolean) {
fun markPackAsInstalled(packId: String, notify: Boolean) {
updatePackInstalled(
db = databaseHelper.signalWritableDatabase,
packId = packKey,
packId = packId,
installed = true,
notify = notify
)

View File

@@ -3,7 +3,7 @@ package org.thoughtcrime.securesms.database.model
import java.util.Optional
/**
* Represents a record for a sticker pack in the [StickerTable].
* Represents a record for a sticker pack in the [org.thoughtcrime.securesms.database.StickerTable].
*/
data class StickerPackRecord(
@JvmField val packId: String,
@@ -19,3 +19,15 @@ data class StickerPackRecord(
@JvmField
val authorOptional: Optional<String> = if (author.isBlank()) Optional.empty() else Optional.of(author)
}
/**
* A unique identifier for a sticker pack.
*/
@JvmInline
value class StickerPackId(val value: String)
/**
* An encryption key for a sticker pack.
*/
@JvmInline
value class StickerPackKey(val value: String)