Skip to content

Commit 53d34e2

Browse files
Fix user profile update issue (#1529)
* Fixed profile name/pic not stored when creating a contact * Revert "Fixed profile name/pic not stored when creating a contact" This reverts commit 8c07cec. * Fixed profile name/pic not stored when creating a contact
1 parent c5f3eba commit 53d34e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/src/main/java/org/session/libsession/messaging/messages/ProfileUpdateHandler.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ class ProfileUpdateHandler @Inject constructor(
143143
lastUpdated: Instant?,
144144
newUpdateTime: Instant?
145145
): Boolean {
146-
return (lastUpdated == null && newUpdateTime == null) ||
147-
(newUpdateTime != null && lastUpdated != null && newUpdateTime > lastUpdated)
146+
val lastUpdatedTimestamp = lastUpdated?.toEpochSeconds() ?: 0L
147+
val newUpdateTimestamp = newUpdateTime?.toEpochSeconds() ?: 0L
148+
149+
return (lastUpdatedTimestamp == 0L && newUpdateTimestamp == 0L) ||
150+
(newUpdateTimestamp > lastUpdatedTimestamp)
148151
}
149152

150153
class Updates private constructor(

0 commit comments

Comments
 (0)