Don't refreshGroups in tryMessageAgain

This was intended to sync the group state of a recently re-installed
client, but is prone to overkill when we have a lot of old stale groups
around. Also this implementation incurs some rate limit errors from the
server.
This commit is contained in:
lilia 2014-12-22 17:34:17 -08:00
parent 2462aba24b
commit f9e68be45b

View file

@ -118,18 +118,16 @@ window.textsecure.messaging = function() {
var message = new Whisper.MessageCollection().add({id: message_id});
message.fetch().then(function() {
textsecure.storage.removeEncrypted("devices" + number);
refreshGroups(number).then(function() {
var proto = textsecure.protobuf.PushMessageContent.decode(encodedMessage, 'binary');
sendMessageProto([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
});
var proto = textsecure.protobuf.PushMessageContent.decode(encodedMessage, 'binary');
sendMessageProto([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
});
});
});