Move from ACI to a generic ServiceId.

This commit is contained in:
Greyson Parrelli
2022-02-17 15:55:54 -05:00
parent 9f1deda220
commit 7ca2420287
110 changed files with 841 additions and 824 deletions

View File

@@ -88,6 +88,11 @@ internal class AccountValues internal constructor(store: KeyValueStore) : Signal
val aci: ACI?
get() = ACI.parseOrNull(getString(KEY_ACI, null))
/** The local user's [ACI]. Will throw if not present. */
fun requireAci(): ACI {
return ACI.parseOrThrow(getString(KEY_ACI, null))
}
fun setAci(aci: ACI) {
putString(KEY_ACI, aci.toString())
}
@@ -96,6 +101,11 @@ internal class AccountValues internal constructor(store: KeyValueStore) : Signal
val pni: PNI?
get() = PNI.parseOrNull(getString(KEY_PNI, null))
/** The local user's [PNI]. Will throw if not present. */
fun requirePni(): PNI {
return PNI.parseOrThrow(getString(KEY_PNI, null))
}
fun setPni(pni: PNI) {
putString(KEY_PNI, pni.toString())
}