enqueueMessageForSend: Capture storage service change on unarchive

This commit is contained in:
Scott Nonnenberg 2022-07-08 16:09:46 -07:00 committed by GitHub
parent 06b606cec3
commit 1dc27a6144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4008,9 +4008,11 @@ export class ConversationModel extends window.Backbone
const { clearUnreadMetrics } = window.reduxActions.conversations;
clearUnreadMetrics(this.id);
const enableProfileSharing = Boolean(
const enabledProfileSharing = Boolean(
mandatoryProfileSharingEnabled && !this.get('profileSharing')
);
const unarchivedConversation = Boolean(this.get('isArchived'));
this.doAddSingleMessage(model, { isJustSent: true });
const draftProperties = dontClearDraft
@ -4024,15 +4026,18 @@ export class ConversationModel extends window.Backbone
this.set({
...draftProperties,
...(enableProfileSharing ? { profileSharing: true } : {}),
...(enabledProfileSharing ? { profileSharing: true } : {}),
...this.incrementSentMessageCount({ dry: true }),
active_at: now,
timestamp: now,
isArchived: false,
...(unarchivedConversation ? { isArchived: false } : {}),
});
if (enableProfileSharing) {
this.captureChange('mandatoryProfileSharing');
if (enabledProfileSharing) {
this.captureChange('enqueueMessageForSend/mandatoryProfileSharing');
}
if (unarchivedConversation) {
this.captureChange('enqueueMessageForSend/unarchive');
}
extraReduxActions?.();