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:
parent
2462aba24b
commit
f9e68be45b
1 changed files with 10 additions and 12 deletions
|
@ -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
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue