Ignore picture commands if chat meta sync is disabled

We get the same data from the message log
This commit is contained in:
Tulir Asokan 2021-02-09 23:52:12 +02:00
parent 2188dc7701
commit 394da69a69
2 changed files with 2 additions and 2 deletions

View file

@ -414,7 +414,7 @@ func (portal *Portal) SyncParticipants(metadata *whatsappExt.GroupInfo) {
}
func (portal *Portal) UpdateAvatar(user *User, avatar *whatsappExt.ProfilePicInfo, updateInfo bool) bool {
if avatar == nil {
if avatar == nil || (avatar.Status == 0 && avatar.Tag != "remove" && len(avatar.URL) == 0) {
var err error
avatar, err = user.Conn.GetProfilePicThumb(portal.Key.JID)
if err != nil {

View file

@ -1090,7 +1090,7 @@ func (user *User) HandleCommand(cmd whatsappExt.Command) {
if strings.HasSuffix(cmd.JID, whatsappExt.NewUserSuffix) {
puppet := user.bridge.GetPuppetByJID(cmd.JID)
go puppet.UpdateAvatar(user, cmd.ProfilePicInfo)
} else {
} else if user.bridge.Config.Bridge.ChatMetaSync {
portal := user.GetPortalByJID(cmd.JID)
go portal.UpdateAvatar(user, cmd.ProfilePicInfo, true)
}