Skip to content

Commit

Permalink
Merge pull request #258 from SamuelScheit/fix-mobile-send-message
Browse files Browse the repository at this point in the history
fix: do not send message to self if the device is 0 (mobile)
  • Loading branch information
Auties00 authored Jul 21, 2023
2 parents cd77ef0 + 64349ca commit 44ec598
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Socket/messages-send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,12 @@ export const makeMessagesSocket = (config: SocketConfig) => {

await authState.keys.set({ 'sender-key-memory': { [jid]: senderKeyMap } })
} else {
const { user: meUser } = jidDecode(meId)!
const { user: meUser, device: meDevice } = jidDecode(meId)!

if(!participant) {
devices.push({ user })
devices.push({ user: meUser })
// do not send message to self if the device is 0 (mobile)
if (meDevice != undefined && meDevice !== 0) devices.push({ user: meUser })

const additionalDevices = await getUSyncDevices([ meId, jid ], !!useUserDevicesCache, true)
devices.push(...additionalDevices)
Expand Down

0 comments on commit 44ec598

Please sign in to comment.