conversation.applyMessageRequestResponse: Always save at the end
This commit is contained in:
parent
947e9c366c
commit
0c6f4248f3
1 changed files with 96 additions and 93 deletions
|
@ -1307,6 +1307,7 @@ export class ConversationModel extends window.Backbone.Model<
|
|||
response: number,
|
||||
{ fromSync = false, viaStorageServiceSync = false } = {}
|
||||
): Promise<void> {
|
||||
try {
|
||||
const messageRequestEnum =
|
||||
window.textsecure.protobuf.SyncMessage.MessageRequestResponse.Type;
|
||||
const isLocalAction = !fromSync && !viaStorageServiceSync;
|
||||
|
@ -1320,14 +1321,13 @@ export class ConversationModel extends window.Backbone.Model<
|
|||
this.set({
|
||||
messageRequestResponseType: response,
|
||||
});
|
||||
window.Signal.Data.updateConversation(this.attributes);
|
||||
|
||||
if (response === messageRequestEnum.ACCEPT) {
|
||||
this.unblock({ viaStorageServiceSync });
|
||||
this.enableProfileSharing({ viaStorageServiceSync });
|
||||
|
||||
// We really don't want to call this if we don't have to. It can take a lot of time
|
||||
// to go through old messages to download attachments.
|
||||
// We really don't want to call this if we don't have to. It can take a lot of
|
||||
// time to go through old messages to download attachments.
|
||||
if (didResponseChange && !wasPreviouslyAccepted) {
|
||||
await this.handleReadAndDownloadAttachments({ isLocalAction });
|
||||
}
|
||||
|
@ -1408,6 +1408,9 @@ export class ConversationModel extends window.Backbone.Model<
|
|||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
window.Signal.Data.updateConversation(this.attributes);
|
||||
}
|
||||
}
|
||||
|
||||
async leaveGroupV2(): Promise<void> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue