From 67bb400b87d2ddacefd934c2b4a4cfbb77552093 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 24 Dec 2014 18:04:47 -0500 Subject: [PATCH] Revert "Don't refreshGroups in tryMessageAgain", making a better one This reverts commit f9e68be45baebc6981e45d44fdeaf1524c1670f9. Conflicts: js/sendmessage.js --- js/sendmessage.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/js/sendmessage.js b/js/sendmessage.js index 25ebd713..1df7028c 100644 --- a/js/sendmessage.js +++ b/js/sendmessage.js @@ -119,15 +119,17 @@ window.textsecure.messaging = function() { message.fetch().then(function() { textsecure.storage.removeEncrypted("devices" + number); var proto = textsecure.protobuf.PushMessageContent.decode(encodedMessage, 'binary'); - sendMessageProto(message.get('sent_at'), [number], proto, function(res) { - if (res.failure.length > 0) { - message.set('errors', res.failure); - } - else { - message.set('errors', []); - } - message.save().then(function(){ - extension.trigger('message', message); // notify frontend listeners + refreshGroups(number).then(function() { + sendMessageProto(message.get('sent_at'), [number], proto, function(res) { + if (res.failure.length > 0) { + message.set('errors', res.failure); + } + else { + message.set('errors', []); + } + message.save().then(function(){ + extension.trigger('message', message); // notify frontend listeners + }); }); }); });