trim Member labels to glyph/byte count instead of throwing

This commit is contained in:
kate-signal 2026-02-09 16:50:10 -05:00 committed by GitHub
parent 56700923e4
commit f47435ba3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,10 +296,7 @@ public extension GroupV2Params {
func decryptMemberLabel(_ ciphertext: Data) throws -> String? {
do {
let decryptedLabel = try decryptString(ciphertext)
guard decryptedLabel.lengthOfBytes(using: .utf8) <= 96 else {
throw OWSAssertionError("member label is too long.")
}
return decryptedLabel.filterStringForDisplay()
return decryptedLabel.filterStringForDisplay().trimToGlyphCount(24).trimToUtf8ByteCount(96)
} catch {
owsFailDebug("Error: \(error)")
throw error