Process attachment before it’s sent

Picked this place since it already had various async steps, similar to
`onMessageReceived` for the incoming `Attachment.process`.

Could we try have this live closer to where we store it in IndexedDB, e.g.
`Conversation::sendMessage`?
This commit is contained in:
Daniel Gasienica 2018-02-13 12:22:29 -05:00
parent a4582ae2fb
commit 532ac3e273
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,8 @@
'use strict';
window.Whisper = window.Whisper || {};
const {Attachment} = window.Whisper;
Whisper.FileSizeToast = Whisper.ToastView.extend({
templateName: 'file-size-modal',
render_attributes: function() {
@ -215,6 +217,7 @@
return this.autoScale(file)
.then(this.readFile)
.then(setFlags(attachmentFlags))
.then(Attachment.process);
},
/* jshint ignore:end */
/* eslint-disable */