handle sending events on messages (sent/error)

pull/1205/head
Audric Ackermann 5 years ago
parent fb7e13acb0
commit 4c890482f7
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -5,7 +5,6 @@
filesize, filesize,
ConversationController, ConversationController,
MessageController, MessageController,
getAccountManager,
i18n, i18n,
Signal, Signal,
textsecure, textsecure,
@ -1003,7 +1002,9 @@
} }
this.set({ errors: null }); this.set({ errors: null });
await window.Signal.Data.saveMessage(this.attributes, {
Message: Whisper.Message,
});
const conversation = this.getConversation(); const conversation = this.getConversation();
const intendedRecipients = this.get('recipients') || []; const intendedRecipients = this.get('recipients') || [];
const successfulRecipients = this.get('sent_to') || []; const successfulRecipients = this.get('sent_to') || [];
@ -1014,7 +1015,7 @@
// : null; // : null;
let recipients = _.intersection(intendedRecipients, currentRecipients); let recipients = _.intersection(intendedRecipients, currentRecipients);
recipients = _.without(recipients, successfulRecipients); recipients = recipients.filter(key => !successfulRecipients.includes(key));
if (!recipients.length) { if (!recipients.length) {
window.log.warn('retrySend: Nobody to send to!'); window.log.warn('retrySend: Nobody to send to!');
@ -1032,6 +1033,7 @@
attachments: attachmentsWithData, attachments: attachmentsWithData,
now: this.get('sent_at'), now: this.get('sent_at'),
}); });
// TODO add logic for attachments, quote and preview here // TODO add logic for attachments, quote and preview here
// don't blindly reuse the one from loadQuoteData loadPreviewData and getLongMessageAttachment. // don't blindly reuse the one from loadQuoteData loadPreviewData and getLongMessageAttachment.
// they have similar data structure to the ones we need // they have similar data structure to the ones we need

@ -326,7 +326,7 @@
} }
msg.set({ msg.set({
sent_to: _.union(sentTo, m.device), sent_to: _.union(sentTo, [m.device]),
sent: true, sent: true,
expirationStartTimestamp: Date.now(), expirationStartTimestamp: Date.now(),
// unidentifiedDeliveries: result.unidentifiedDeliveries, // unidentifiedDeliveries: result.unidentifiedDeliveries,
@ -366,7 +366,6 @@
msg.set({ sentSync: false }); msg.set({ sentSync: false });
} }
msg.set({ msg.set({
// sent_to: _.union(sentTo, m.device),
sent: true, sent: true,
expirationStartTimestamp, expirationStartTimestamp,
// unidentifiedDeliveries: result.unidentifiedDeliveries, // unidentifiedDeliveries: result.unidentifiedDeliveries,

Loading…
Cancel
Save