Update jid-utils.ts

This commit is contained in:
Rajeh Taher
2023-10-01 14:53:33 +03:00
committed by GitHub
parent ba43be9c98
commit 3bf4201ed3

View File

@@ -30,12 +30,12 @@ export const jidDecode = (jid: string | undefined): FullJid | undefined => {
const userCombined = jid!.slice(0, sepIdx) const userCombined = jid!.slice(0, sepIdx)
const [userAgent, device] = userCombined.split(':') const [userAgent, device] = userCombined.split(':')
const [user, agent] = userAgent.split('_') const user = userAgent.split('_')[0]
return { return {
server, server,
user, user,
agent: agent ? +agent : undefined, domainType: server == "lid" ? 1 : 0,
device: device ? +device : undefined device: device ? +device : undefined
} }
} }