fix: only update and fetch a new profile pic if it's actually different from our current one

This commit is contained in:
jubb 2021-03-03 15:59:28 +11:00
parent 1ecc87da76
commit 85c1d38bb4

View File

@ -122,7 +122,7 @@ object MultiDeviceProtocol {
val profileKey = Base64.encodeBytes(configurationMessage.profileKey)
ProfileKeyUtil.setEncodedProfileKey(context, profileKey)
recipientDatabase.setProfileKey(ourRecipient, configurationMessage.profileKey)
if (!configurationMessage.profilePicture.isNullOrEmpty()) {
if (!configurationMessage.profilePicture.isNullOrEmpty() && TextSecurePreferences.getProfilePictureURL(context) != configurationMessage.profilePicture) {
TextSecurePreferences.setProfilePictureURL(context, configurationMessage.profilePicture)
TextSecurePreferences.setProfileAvatarId(context, SecureRandom().nextInt())
ApplicationContext.getInstance(context).jobManager.add(RetrieveProfileAvatarJob(ourRecipient, configurationMessage.profilePicture))