@@ -63,27 +63,37 @@ func BuildMute(target types.JID, mute bool, muteDuration time.Duration) PatchInf
63
63
}
64
64
}
65
65
66
- func BuildContact (target types.JID , fullName string , add bool ) PatchInfo {
67
- operation := waServerSync .SyncdMutation_SET
68
- if ! add {
69
- operation = waServerSync .SyncdMutation_REMOVE
70
- }
66
+ func BuildContact (target types.JID , fullName string ) PatchInfo {
71
67
return PatchInfo {
72
68
Type : WAPatchCriticalUnblockLow ,
73
- Operation : operation ,
69
+ Operation : waServerSync . SyncdMutation_SET ,
74
70
Mutations : []MutationInfo {{
75
71
Index : []string {IndexContact , target .String ()},
76
72
Version : 2 ,
77
73
Value : & waSyncAction.SyncActionValue {
78
74
ContactAction : & waSyncAction.ContactAction {
79
75
FullName : & fullName ,
80
- SaveOnPrimaryAddressbook : proto .Bool (add ),
76
+ SaveOnPrimaryAddressbook : proto .Bool (true ),
81
77
},
82
78
},
83
79
}},
84
80
}
85
81
}
86
82
83
+ func RemoveContact (target types.JID ) PatchInfo {
84
+ return PatchInfo {
85
+ Type : WAPatchCriticalUnblockLow ,
86
+ Operation : waServerSync .SyncdMutation_REMOVE ,
87
+ Mutations : []MutationInfo {{
88
+ Index : []string {IndexContact , target .String ()},
89
+ Version : 2 ,
90
+ Value : & waSyncAction.SyncActionValue {
91
+ ContactAction : & waSyncAction.ContactAction {},
92
+ },
93
+ }},
94
+ }
95
+ }
96
+
87
97
func newPinMutationInfo (target types.JID , pin bool ) MutationInfo {
88
98
return MutationInfo {
89
99
Index : []string {IndexPin , target .String ()},
0 commit comments