mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'charlesmchen/avatarSeed'
This commit is contained in:
commit
ba95034ce7
|
@ -47,9 +47,17 @@ public class ContactShareViewModel: NSObject {
|
|||
return avatarImage
|
||||
}
|
||||
|
||||
// TODO: What's the best colorSeed value to use?
|
||||
var colorSeed = name.displayName
|
||||
let recipientIds = systemContactsWithSignalAccountPhoneNumbers(contactsManager)
|
||||
if let firstRecipientId = recipientIds.first {
|
||||
// Try to use the first signal id as the default
|
||||
// avatar's color seed, so that it is as consistent
|
||||
// as possible with the user's avatar in other views.
|
||||
colorSeed = firstRecipientId
|
||||
}
|
||||
|
||||
let avatarBuilder = OWSContactAvatarBuilder(nonSignalName: displayName,
|
||||
colorSeed: displayName,
|
||||
colorSeed: colorSeed,
|
||||
diameter: UInt(diameter),
|
||||
contactsManager: contactsManager)
|
||||
return avatarBuilder.build()
|
||||
|
|
Loading…
Reference in a new issue