mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix profile updating bug
This commit is contained in:
parent
371222098b
commit
d516aa7ecb
1 changed files with 2 additions and 2 deletions
|
@ -316,7 +316,7 @@ extension MessageReceiver {
|
||||||
: OWSUserProfile.fetch(uniqueId: publicKey, transaction: transaction) // Old API
|
: OWSUserProfile.fetch(uniqueId: publicKey, transaction: transaction) // Old API
|
||||||
let contact = Storage.shared.getContact(with: publicKey) ?? Contact(sessionID: publicKey) // New API
|
let contact = Storage.shared.getContact(with: publicKey) ?? Contact(sessionID: publicKey) // New API
|
||||||
// Name
|
// Name
|
||||||
if let name = name, name != owsProfile?.profileName {
|
if let name = name, (name != owsProfile?.profileName || contact.name != owsProfile?.profileName) {
|
||||||
let shouldUpdate: Bool
|
let shouldUpdate: Bool
|
||||||
if isCurrentUser {
|
if isCurrentUser {
|
||||||
shouldUpdate = given(userDefaults[.lastDisplayNameUpdate]) { sentTimestamp > UInt64($0.timeIntervalSince1970 * 1000) } ?? true
|
shouldUpdate = given(userDefaults[.lastDisplayNameUpdate]) { sentTimestamp > UInt64($0.timeIntervalSince1970 * 1000) } ?? true
|
||||||
|
@ -335,7 +335,7 @@ extension MessageReceiver {
|
||||||
}
|
}
|
||||||
// Profile picture & profile key
|
// Profile picture & profile key
|
||||||
if let profileKey = profileKey, let profilePictureURL = profilePictureURL, profileKey.keyData.count == kAES256_KeyByteLength,
|
if let profileKey = profileKey, let profilePictureURL = profilePictureURL, profileKey.keyData.count == kAES256_KeyByteLength,
|
||||||
profileKey != owsProfile?.profileKey {
|
(profileKey != owsProfile?.profileKey || contact.profilePictureEncryptionKey != owsProfile?.profileKey) {
|
||||||
let shouldUpdate: Bool
|
let shouldUpdate: Bool
|
||||||
if isCurrentUser {
|
if isCurrentUser {
|
||||||
shouldUpdate = given(userDefaults[.lastProfilePictureUpdate]) { sentTimestamp > UInt64($0.timeIntervalSince1970 * 1000) } ?? true
|
shouldUpdate = given(userDefaults[.lastProfilePictureUpdate]) { sentTimestamp > UInt64($0.timeIntervalSince1970 * 1000) } ?? true
|
||||||
|
|
Loading…
Reference in a new issue