Dont forward group story replies into conversation
This commit is contained in:
parent
80f8f38e33
commit
3e73b30a9d
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue