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 + }); }); }); });