feat: implement pin chat modification

This commit is contained in:
Adhiraj Singh
2021-11-25 13:36:29 +05:30
parent 032b2a314b
commit ddf6daba65
2 changed files with 15 additions and 0 deletions

View File

@@ -382,9 +382,12 @@ export const makeChatsSocket = (config: SocketConfig) => {
name: action?.pushNameSetting?.name!
}
ev.emit('creds.update', { me })
} else if(action?.pinAction) {
update.pin = action.pinAction?.pinned ? toNumber(action.timestamp) : undefined
} else {
logger.warn({ action, id }, 'unprocessable update')
}
if(Object.keys(update).length > 1) {
updates[update.id] = {
...(updates[update.id] || {}),