Passive UUID support
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
f64ca0ed21
commit
a90246cbe5
49 changed files with 2226 additions and 776 deletions
|
@ -25,7 +25,7 @@
|
|||
const receipts = this.filter(
|
||||
receipt =>
|
||||
receipt.get('timestamp') === message.get('sent_at') &&
|
||||
recipients.indexOf(receipt.get('source')) > -1
|
||||
recipients.indexOf(receipt.get('deliveredTo')) > -1
|
||||
);
|
||||
this.remove(receipts);
|
||||
return receipts;
|
||||
|
@ -34,19 +34,23 @@
|
|||
if (messages.length === 0) {
|
||||
return null;
|
||||
}
|
||||
const sourceId = ConversationController.getConversationId(source);
|
||||
const message = messages.find(
|
||||
item => !item.isIncoming() && source === item.get('conversationId')
|
||||
item => !item.isIncoming() && sourceId === item.get('conversationId')
|
||||
);
|
||||
if (message) {
|
||||
return MessageController.register(message.id, message);
|
||||
}
|
||||
|
||||
const groups = await window.Signal.Data.getAllGroupsInvolvingId(source, {
|
||||
ConversationCollection: Whisper.ConversationCollection,
|
||||
});
|
||||
const groups = await window.Signal.Data.getAllGroupsInvolvingId(
|
||||
sourceId,
|
||||
{
|
||||
ConversationCollection: Whisper.ConversationCollection,
|
||||
}
|
||||
);
|
||||
|
||||
const ids = groups.pluck('id');
|
||||
ids.push(source);
|
||||
ids.push(sourceId);
|
||||
|
||||
const target = messages.find(
|
||||
item =>
|
||||
|
@ -68,25 +72,25 @@
|
|||
);
|
||||
|
||||
const message = await this.getTargetMessage(
|
||||
receipt.get('source'),
|
||||
receipt.get('deliveredTo'),
|
||||
messages
|
||||
);
|
||||
if (!message) {
|
||||
window.log.info(
|
||||
'No message for delivery receipt',
|
||||
receipt.get('source'),
|
||||
receipt.get('deliveredTo'),
|
||||
receipt.get('timestamp')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const deliveries = message.get('delivered') || 0;
|
||||
const deliveredTo = message.get('delivered_to') || [];
|
||||
const deliveredTo = message.get('deliveredTo') || [];
|
||||
const expirationStartTimestamp = message.get(
|
||||
'expirationStartTimestamp'
|
||||
);
|
||||
message.set({
|
||||
delivered_to: _.union(deliveredTo, [receipt.get('source')]),
|
||||
delivered_to: _.union(deliveredTo, [receipt.get('deliveredTo')]),
|
||||
delivered: deliveries + 1,
|
||||
expirationStartTimestamp: expirationStartTimestamp || Date.now(),
|
||||
sent: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue