From 152f5a57b52cc5a68d5004cdc4afa1d0026e5749 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 6 Jul 2022 13:54:32 +0300 Subject: [PATCH] Fix handling not found avatars --- portal.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/portal.go b/portal.go index 330598d..287736b 100644 --- a/portal.go +++ b/portal.go @@ -944,9 +944,13 @@ func (user *User) updateAvatar(jid types.JID, avatarID *string, avatarURL *id.Co } return false } else if errors.Is(err, whatsmeow.ErrProfilePictureNotSet) { - *avatarURL = id.ContentURI{} avatar = &types.ProfilePictureInfo{ID: "remove"} - // Fall through to the rest of the avatar handling code + if avatar.ID == *avatarID && *avatarSet { + return false + } + *avatarID = avatar.ID + *avatarURL = id.ContentURI{} + return true } else if err != nil { log.Warnln("Failed to get avatar URL:", err) return false