Use the new avatar color hash algorithm.

This commit is contained in:
Greyson Parrelli
2025-03-05 12:35:33 -05:00
committed by Michelle Tang
parent 19bf6f95c7
commit f0f25ae12e
3 changed files with 47 additions and 16 deletions

View File

@@ -4098,7 +4098,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
PNI_COLUMN to pni?.toString(),
PNI_SIGNATURE_VERIFIED to pniVerified.toInt(),
STORAGE_SERVICE_ID to Base64.encodeWithPadding(StorageSyncHelper.generateKey()),
AVATAR_COLOR to AvatarColorHash.forAddress((aci ?: pni)?.toString(), e164).serialize()
AVATAR_COLOR to AvatarColorHash.forAddress((aci ?: pni), e164).serialize()
)
if (pni != null || aci != null) {
@@ -4155,7 +4155,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
}
if (isInsert) {
put(AVATAR_COLOR, AvatarColorHash.forAddress(contact.proto.signalAci?.toString() ?: contact.proto.signalPni?.toString(), contact.proto.e164).serialize())
put(AVATAR_COLOR, AvatarColorHash.forAddress(contact.proto.signalAci ?: contact.proto.signalPni, contact.proto.e164).serialize())
}
}
}