mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Fix handling not found avatars
This commit is contained in:
parent
2bc5c32d48
commit
152f5a57b5
1 changed files with 6 additions and 2 deletions
|
@ -944,9 +944,13 @@ func (user *User) updateAvatar(jid types.JID, avatarID *string, avatarURL *id.Co
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
} else if errors.Is(err, whatsmeow.ErrProfilePictureNotSet) {
|
} else if errors.Is(err, whatsmeow.ErrProfilePictureNotSet) {
|
||||||
*avatarURL = id.ContentURI{}
|
|
||||||
avatar = &types.ProfilePictureInfo{ID: "remove"}
|
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 {
|
} else if err != nil {
|
||||||
log.Warnln("Failed to get avatar URL:", err)
|
log.Warnln("Failed to get avatar URL:", err)
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue