MessageReceiver: Use UUID if we have it
This commit is contained in:
parent
8e656c2cf1
commit
9f73b40d7a
4 changed files with 10 additions and 5 deletions
|
@ -2663,12 +2663,16 @@
|
||||||
let sentTo = [];
|
let sentTo = [];
|
||||||
|
|
||||||
if (data.unidentifiedStatus && data.unidentifiedStatus.length) {
|
if (data.unidentifiedStatus && data.unidentifiedStatus.length) {
|
||||||
sentTo = data.unidentifiedStatus.map(item => item.destination);
|
sentTo = data.unidentifiedStatus.map(
|
||||||
|
item => item.destinationUuid || item.destination
|
||||||
|
);
|
||||||
const unidentified = _.filter(data.unidentifiedStatus, item =>
|
const unidentified = _.filter(data.unidentifiedStatus, item =>
|
||||||
Boolean(item.unidentified)
|
Boolean(item.unidentified)
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
data.unidentifiedDeliveries = unidentified.map(item => item.destination);
|
data.unidentifiedDeliveries = unidentified.map(
|
||||||
|
item => item.destinationUuid || item.destination
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Whisper.Message({
|
return new Whisper.Message({
|
||||||
|
|
|
@ -517,7 +517,7 @@ SecretSessionCipher.prototype = {
|
||||||
const signalProtocolStore = this.storage;
|
const signalProtocolStore = this.storage;
|
||||||
|
|
||||||
const sender = new libsignal.SignalProtocolAddress(
|
const sender = new libsignal.SignalProtocolAddress(
|
||||||
message.senderCertificate.sender || message.senderCertificate.senderUuid,
|
message.senderCertificate.senderUuid || message.senderCertificate.sender,
|
||||||
message.senderCertificate.senderDevice
|
message.senderCertificate.senderDevice
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -211,6 +211,7 @@ function applyMessageRequestState(
|
||||||
}
|
}
|
||||||
|
|
||||||
type RecordClassObject = {
|
type RecordClassObject = {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -839,7 +839,7 @@ class MessageReceiverInner extends EventTarget {
|
||||||
|
|
||||||
let address: SignalProtocolAddressClass;
|
let address: SignalProtocolAddressClass;
|
||||||
let promise;
|
let promise;
|
||||||
const identifier = envelope.source || envelope.sourceUuid;
|
const identifier = envelope.sourceUuid || envelope.source;
|
||||||
|
|
||||||
address = new window.libsignal.SignalProtocolAddress(
|
address = new window.libsignal.SignalProtocolAddress(
|
||||||
// Using source as opposed to sourceUuid allows us to get the existing
|
// Using source as opposed to sourceUuid allows us to get the existing
|
||||||
|
@ -1140,7 +1140,7 @@ class MessageReceiverInner extends EventTarget {
|
||||||
window.log.info('data message from', this.getEnvelopeId(envelope));
|
window.log.info('data message from', this.getEnvelopeId(envelope));
|
||||||
let p: Promise<any> = Promise.resolve();
|
let p: Promise<any> = Promise.resolve();
|
||||||
// eslint-disable-next-line no-bitwise
|
// eslint-disable-next-line no-bitwise
|
||||||
const destination = envelope.source || envelope.sourceUuid;
|
const destination = envelope.sourceUuid || envelope.source;
|
||||||
if (!destination) {
|
if (!destination) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'MessageReceiver.handleDataMessage: source and sourceUuid were falsey'
|
'MessageReceiver.handleDataMessage: source and sourceUuid were falsey'
|
||||||
|
|
Loading…
Add table
Reference in a new issue