Ensure ACI/PNI are associated after processing a PNI promotion message.

This commit is contained in:
Greyson Parrelli
2023-11-29 10:02:47 -05:00
committed by Cody Henthorne
parent 15f1201a76
commit 4a0abbbee7
2 changed files with 13 additions and 3 deletions

View File

@@ -197,6 +197,10 @@ sealed class ServiceId(val libSignalServiceId: LibSignalServiceId) {
}
}
/** Parses a [ByteString] as a PNI, regardless if the `PNI:` prefix is present or not. Only use this if you are certain that what you're reading is a PNI. */
@JvmStatic
fun parseOrNull(bytes: ByteString): PNI? = parseOrNull(bytes.toByteArray())
/** Parses a string as a PNI, regardless if the `PNI:` prefix is present or not. Only use this if you are certain that what you're reading is a PNI. */
@JvmStatic
@Throws(IllegalArgumentException::class)