Move receipt queues into conversation queue to handle 428s
This commit is contained in:
@@ -55,11 +55,15 @@ import type { BoundActionCreatorsMapObject } from '../../hooks/useBoundActions';
|
||||
import { useBoundActions } from '../../hooks/useBoundActions';
|
||||
import { verifyStoryListMembers as doVerifyStoryListMembers } from '../../util/verifyStoryListMembers';
|
||||
import { viewSyncJobQueue } from '../../jobs/viewSyncJobQueue';
|
||||
import { viewedReceiptsJobQueue } from '../../jobs/viewedReceiptsJobQueue';
|
||||
import { getOwn } from '../../util/getOwn';
|
||||
import { SHOW_TOAST } from './toast';
|
||||
import { ToastType } from '../../types/Toast';
|
||||
import type { ShowToastActionType } from './toast';
|
||||
import {
|
||||
conversationJobQueue,
|
||||
conversationQueueJobEnum,
|
||||
} from '../../jobs/conversationJobQueue';
|
||||
import { ReceiptType } from '../../types/Receipt';
|
||||
|
||||
export type StoryDataType = ReadonlyDeep<
|
||||
{
|
||||
@@ -399,8 +403,11 @@ function markStoryRead(
|
||||
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
|
||||
});
|
||||
|
||||
const conversationId = message.get('conversationId');
|
||||
|
||||
const viewedReceipt = {
|
||||
messageId,
|
||||
conversationId,
|
||||
senderE164: message.attributes.source,
|
||||
senderUuid: message.attributes.sourceUuid,
|
||||
timestamp: message.attributes.sent_at,
|
||||
@@ -413,7 +420,14 @@ function markStoryRead(
|
||||
}
|
||||
|
||||
if (window.Events.getStoryViewReceiptsEnabled()) {
|
||||
drop(viewedReceiptsJobQueue.add({ viewedReceipt }));
|
||||
drop(
|
||||
conversationJobQueue.add({
|
||||
type: conversationQueueJobEnum.enum.Receipts,
|
||||
conversationId,
|
||||
receiptsType: ReceiptType.Viewed,
|
||||
receipts: [viewedReceipt],
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
await dataInterface.addNewStoryRead({
|
||||
|
Reference in New Issue
Block a user