Wrap delivery receipt sends in conversation.queueJob
This commit is contained in:
parent
56470d8374
commit
8eed6b62b9
1 changed files with 22 additions and 20 deletions
|
@ -32,26 +32,28 @@
|
||||||
const source = sources[i];
|
const source = sources[i];
|
||||||
const timestamps = bySource[source].map(item => item.timestamp);
|
const timestamps = bySource[source].map(item => item.timestamp);
|
||||||
|
|
||||||
try {
|
const c = ConversationController.get(source);
|
||||||
const c = ConversationController.get(source);
|
c.queueJob(async () => {
|
||||||
const { wrap, sendOptions } = ConversationController.prepareForSend(
|
try {
|
||||||
c.get('id')
|
const { wrap, sendOptions } = ConversationController.prepareForSend(
|
||||||
);
|
c.get('id')
|
||||||
// eslint-disable-next-line no-await-in-loop
|
);
|
||||||
await wrap(
|
// eslint-disable-next-line no-await-in-loop
|
||||||
textsecure.messaging.sendDeliveryReceipt(
|
await wrap(
|
||||||
c.get('e164'),
|
textsecure.messaging.sendDeliveryReceipt(
|
||||||
c.get('uuid'),
|
c.get('e164'),
|
||||||
timestamps,
|
c.get('uuid'),
|
||||||
sendOptions
|
timestamps,
|
||||||
)
|
sendOptions
|
||||||
);
|
)
|
||||||
} catch (error) {
|
);
|
||||||
window.log.error(
|
} catch (error) {
|
||||||
`Failed to send delivery receipt to ${source} for timestamps ${timestamps}:`,
|
window.log.error(
|
||||||
error && error.stack ? error.stack : error
|
`Failed to send delivery receipt to ${source} for timestamps ${timestamps}:`,
|
||||||
);
|
error && error.stack ? error.stack : error
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue