diff --git a/ts/session/sending/MessageQueue.ts b/ts/session/sending/MessageQueue.ts index a0c83c731..f4741ab93 100644 --- a/ts/session/sending/MessageQueue.ts +++ b/ts/session/sending/MessageQueue.ts @@ -1,4 +1,3 @@ -import * as _ from 'lodash'; import { getPairedDevicesFor } from '../../../js/modules/data'; import { EventEmitter } from 'events'; @@ -64,7 +63,10 @@ export class MessageQueue implements MessageQueueInterface { ); await this.sendSyncMessage(message, ourDevices); - currentDevices = _.xor(currentDevices, ourDevices); + // Remove our devices from currentDevices + currentDevices = currentDevices.filter(device => + ourDevices.some(d => PubKey.isEqual(d, device)) + ); } } diff --git a/ts/session/types/PubKey.ts b/ts/session/types/PubKey.ts index 59fccf119..f183cb363 100644 --- a/ts/session/types/PubKey.ts +++ b/ts/session/types/PubKey.ts @@ -27,7 +27,7 @@ export class PubKey { return false; } - public static isEqual(first: PubKey, second: PubKey) { - return first.key === second.key; + public static isEqual(key: PubKey, comparator: PubKey) { + return key.key === comparator.key; } }