Clean up old messages, better handle errors from sending

This commit is contained in:
Scott Nonnenberg 2018-08-07 12:33:56 -07:00
parent bf63c7cc13
commit 727925a266
10 changed files with 232 additions and 66 deletions

View file

@ -797,6 +797,18 @@
});
message.set({ id });
// We're offline!
if (!textsecure.messaging) {
const errors = this.contactCollection.map(contact => {
const error = new Error('Network is not available');
error.name = 'SendMessageNetworkError';
error.number = contact.id;
return error;
});
await message.saveErrors(errors);
return;
}
const conversationType = this.get('type');
const sendFunction = (() => {
switch (conversationType) {