Allow key conflict resolution for group updates
Creating a group with a member who's identity key has changed would previously fail silently. Now, we catch and save the error, allowing the same conflict resolution process as with regular messages. Fixes #205
This commit is contained in:
parent
4bd46f80e7
commit
e8cb4efaa4
1 changed files with 7 additions and 4 deletions
|
@ -128,8 +128,8 @@
|
|||
this.trigger('open', {modelId: groupId});
|
||||
}.bind(this));
|
||||
var now = Date.now();
|
||||
group.messageCollection.add({
|
||||
conversationId : this.id,
|
||||
var message = group.messageCollection.add({
|
||||
conversationId : group.id,
|
||||
type : 'outgoing',
|
||||
sent_at : now,
|
||||
received_at : now,
|
||||
|
@ -138,13 +138,16 @@
|
|||
avatar: group.get('avatar'),
|
||||
joined: group.get('members')
|
||||
}
|
||||
}).save();
|
||||
});
|
||||
message.save();
|
||||
textsecure.messaging.updateGroup(
|
||||
group.id,
|
||||
group.get('name'),
|
||||
group.get('avatar'),
|
||||
group.get('members')
|
||||
);
|
||||
).catch(function(errors) {
|
||||
message.save({errors: errors.map(function(e){return e.error;})});
|
||||
});
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue