forked from MirrorHub/mautrix-whatsapp
Handle puppet avatar fetch errors properly
This commit is contained in:
parent
2f78d803c2
commit
d7b36d55d7
2 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue