Dont forward group story replies into conversation

This commit is contained in:
Jamie Kyle 2022-10-04 11:42:42 -07:00 committed by GitHub
parent 80f8f38e33
commit 3e73b30a9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 40 deletions

View File

@ -4027,53 +4027,56 @@ export class ConversationModel extends window.Backbone
const renderStart = Date.now(); const renderStart = Date.now();
// Perform asynchronous tasks before entering the batching mode // Don't update the conversation with a story reply
await this.beforeAddSingleMessage(); if (storyId == null) {
// Perform asynchronous tasks before entering the batching mode
await this.beforeAddSingleMessage();
this.isInReduxBatch = true; this.isInReduxBatch = true;
batchDispatch(() => { batchDispatch(() => {
try { try {
const { clearUnreadMetrics } = window.reduxActions.conversations; const { clearUnreadMetrics } = window.reduxActions.conversations;
clearUnreadMetrics(this.id); clearUnreadMetrics(this.id);
const enabledProfileSharing = Boolean( const enabledProfileSharing = Boolean(
mandatoryProfileSharingEnabled && !this.get('profileSharing') mandatoryProfileSharingEnabled && !this.get('profileSharing')
); );
const unarchivedConversation = Boolean(this.get('isArchived')); const unarchivedConversation = Boolean(this.get('isArchived'));
this.doAddSingleMessage(model, { isJustSent: true }); this.doAddSingleMessage(model, { isJustSent: true });
const draftProperties = dontClearDraft const draftProperties = dontClearDraft
? {} ? {}
: { : {
draft: null, draft: null,
draftTimestamp: null, draftTimestamp: null,
lastMessage: model.getNotificationText(), lastMessage: model.getNotificationText(),
lastMessageAuthor: model.getAuthorText(), lastMessageAuthor: model.getAuthorText(),
lastMessageStatus: 'sending' as const, lastMessageStatus: 'sending' as const,
}; };
this.set({ this.set({
...draftProperties, ...draftProperties,
...(enabledProfileSharing ? { profileSharing: true } : {}), ...(enabledProfileSharing ? { profileSharing: true } : {}),
...this.incrementSentMessageCount({ dry: true }), ...this.incrementSentMessageCount({ dry: true }),
active_at: now, active_at: now,
timestamp: now, timestamp: now,
...(unarchivedConversation ? { isArchived: false } : {}), ...(unarchivedConversation ? { isArchived: false } : {}),
}); });
if (enabledProfileSharing) { if (enabledProfileSharing) {
this.captureChange('enqueueMessageForSend/mandatoryProfileSharing'); this.captureChange('enqueueMessageForSend/mandatoryProfileSharing');
}
if (unarchivedConversation) {
this.captureChange('enqueueMessageForSend/unarchive');
}
extraReduxActions?.();
} finally {
this.isInReduxBatch = false;
} }
if (unarchivedConversation) { });
this.captureChange('enqueueMessageForSend/unarchive'); }
}
extraReduxActions?.();
} finally {
this.isInReduxBatch = false;
}
});
if (sticker) { if (sticker) {
await addStickerPackReference(model.id, sticker.packId); await addStickerPackReference(model.id, sticker.packId);