[feat]: add/edit/remove contacts (#1172)
* add/edit/remove contacts * use proto type in contact action --------- Co-authored-by: canove <cassio@economicros.com.br>
This commit is contained in:
@@ -858,6 +858,30 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or Edit Contact
|
||||
*/
|
||||
const addOrEditContact = (jid: string, contact: proto.SyncActionValue.IContactAction) => {
|
||||
return chatModify(
|
||||
{
|
||||
contact
|
||||
},
|
||||
jid
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Contact
|
||||
*/
|
||||
const removeContact = (jid: string) => {
|
||||
return chatModify(
|
||||
{
|
||||
contact: null
|
||||
},
|
||||
jid
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds label
|
||||
*/
|
||||
@@ -1087,6 +1111,8 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
resyncAppState,
|
||||
chatModify,
|
||||
cleanDirtyBits,
|
||||
addOrEditContact,
|
||||
removeContact,
|
||||
addLabel,
|
||||
addChatLabel,
|
||||
removeChatLabel,
|
||||
|
||||
Reference in New Issue
Block a user