feat: send presence update when name changed

This commit is contained in:
Adhiraj Singh
2022-04-08 23:29:48 +05:30
parent 060c838707
commit f1b64c3c35
2 changed files with 8 additions and 2 deletions

View File

@@ -466,6 +466,10 @@ export const makeChatsSocket = (config: SocketConfig) => {
const processSyncActionsLocal = (actions: ChatMutation[]) => {
const events = processSyncActions(actions, authState.creds.me!, logger)
emitEventsFromMap(events)
// resend available presence to update name on servers
if(events['creds.update']?.me?.name) {
sendPresenceUpdate('available')
}
}
const appPatch = async(patchCreate: WAPatchCreate) => {