diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index b1442bef51..41d68f3dc1 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -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?.();