diff --git a/js/models/messages.js b/js/models/messages.js index 0e41b7e26..f98076e3f 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -5,7 +5,6 @@ filesize, ConversationController, MessageController, - getAccountManager, i18n, Signal, textsecure, @@ -1003,7 +1002,9 @@ } this.set({ errors: null }); - + await window.Signal.Data.saveMessage(this.attributes, { + Message: Whisper.Message, + }); const conversation = this.getConversation(); const intendedRecipients = this.get('recipients') || []; const successfulRecipients = this.get('sent_to') || []; @@ -1014,7 +1015,7 @@ // : null; let recipients = _.intersection(intendedRecipients, currentRecipients); - recipients = _.without(recipients, successfulRecipients); + recipients = recipients.filter(key => !successfulRecipients.includes(key)); if (!recipients.length) { window.log.warn('retrySend: Nobody to send to!'); @@ -1032,6 +1033,7 @@ attachments: attachmentsWithData, now: this.get('sent_at'), }); + // TODO add logic for attachments, quote and preview here // don't blindly reuse the one from loadQuoteData loadPreviewData and getLongMessageAttachment. // they have similar data structure to the ones we need diff --git a/js/views/inbox_view.js b/js/views/inbox_view.js index fed468cf7..fbd22e6e7 100644 --- a/js/views/inbox_view.js +++ b/js/views/inbox_view.js @@ -326,7 +326,7 @@ } msg.set({ - sent_to: _.union(sentTo, m.device), + sent_to: _.union(sentTo, [m.device]), sent: true, expirationStartTimestamp: Date.now(), // unidentifiedDeliveries: result.unidentifiedDeliveries, @@ -366,7 +366,6 @@ msg.set({ sentSync: false }); } msg.set({ - // sent_to: _.union(sentTo, m.device), sent: true, expirationStartTimestamp, // unidentifiedDeliveries: result.unidentifiedDeliveries,