diff --git a/portal.go b/portal.go index d82b830..4f7be1a 100644 --- a/portal.go +++ b/portal.go @@ -326,9 +326,11 @@ func (portal *Portal) UpdateAvatar(user *User, avatar *whatsappExt.ProfilePicInf } } - if avatar.Status != 0 { - // 401: ??? - // 404: ??? + if avatar.Status != 0 && avatar.Status != 404 { + // 401s can happen a lot so let's not log those. + if avatar.Status != 401 { + portal.log.Warnln("Unexpected avatar update status code, not updating.", avatar) + } return false } diff --git a/puppet.go b/puppet.go index 70ab56d..6ad656f 100644 --- a/puppet.go +++ b/puppet.go @@ -136,6 +136,14 @@ func (puppet *Puppet) UpdateAvatar(source *User, avatar *whatsappExt.ProfilePicI } } + if avatar.Status != 0 && avatar.Status != 404 { + // 401s can happen a lot so let's not log those. + if avatar.Status != 401 { + puppet.log.Warnln("Unexpected avatar update status code, not updating.", avatar) + } + return false + } + if avatar.Tag == puppet.Avatar { return false }