Browse Source

Ignore picture commands if chat meta sync is disabled

We get the same data from the message log
Tulir Asokan 4 years ago
parent
commit
394da69a69
2 changed files with 2 additions and 2 deletions
  1. 1 1
      portal.go
  2. 1 1
      user.go

+ 1 - 1
portal.go

@@ -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 {

+ 1 - 1
user.go

@@ -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)
 		}