bridgev2: always update avatar if MXC changes

When using direct downloads only the MXC changes but hash stays empty.
This commit is contained in:
Toni Spets 2025-05-06 09:01:02 +03:00
commit 03f7116806
2 changed files with 2 additions and 2 deletions

View file

@ -162,7 +162,7 @@ func (ghost *Ghost) UpdateAvatar(ctx context.Context, avatar *Avatar) bool {
ghost.AvatarSet = false
zerolog.Ctx(ctx).Err(err).Msg("Failed to reupload avatar")
return true
} else if newHash == ghost.AvatarHash && ghost.AvatarSet {
} else if newMXC == ghost.AvatarMXC && newHash == ghost.AvatarHash && ghost.AvatarSet {
return true
}
ghost.AvatarHash = newHash

View file

@ -3041,7 +3041,7 @@ func (portal *Portal) updateAvatar(ctx context.Context, avatar *Avatar, sender M
portal.AvatarSet = false
zerolog.Ctx(ctx).Err(err).Msg("Failed to reupload room avatar")
return true
} else if newHash == portal.AvatarHash && portal.AvatarSet {
} else if newMXC == portal.AvatarMXC && newHash == portal.AvatarHash && portal.AvatarSet {
return true
}
portal.AvatarMXC = newMXC