2022-01-14 21:34:52 +00:00
|
|
|
// Copyright 2021-2022 Signal Messenger, LLC
|
2021-04-29 23:02:27 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-07-23 17:23:50 +00:00
|
|
|
import type { WebAPIType } from '../textsecure/WebAPI';
|
|
|
|
|
2022-02-16 18:36:21 +00:00
|
|
|
import { conversationJobQueue } from './conversationJobQueue';
|
2021-12-07 22:41:40 +00:00
|
|
|
import { deliveryReceiptsJobQueue } from './deliveryReceiptsJobQueue';
|
|
|
|
import { readReceiptsJobQueue } from './readReceiptsJobQueue';
|
2021-07-23 22:02:36 +00:00
|
|
|
import { readSyncJobQueue } from './readSyncJobQueue';
|
2021-04-29 23:02:27 +00:00
|
|
|
import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue';
|
2021-05-27 20:17:05 +00:00
|
|
|
import { reportSpamJobQueue } from './reportSpamJobQueue';
|
2022-01-14 21:34:52 +00:00
|
|
|
import { singleProtoJobQueue } from './singleProtoJobQueue';
|
2022-02-08 17:30:42 +00:00
|
|
|
import { viewOnceOpenJobQueue } from './viewOnceOpenJobQueue';
|
2021-08-12 18:15:55 +00:00
|
|
|
import { viewSyncJobQueue } from './viewSyncJobQueue';
|
2021-08-17 15:43:26 +00:00
|
|
|
import { viewedReceiptsJobQueue } from './viewedReceiptsJobQueue';
|
2021-04-29 23:02:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Start all of the job queues. Should be called when the database is ready.
|
|
|
|
*/
|
2021-07-23 17:23:50 +00:00
|
|
|
export function initializeAllJobQueues({
|
|
|
|
server,
|
|
|
|
}: {
|
|
|
|
server: WebAPIType;
|
|
|
|
}): void {
|
|
|
|
reportSpamJobQueue.initialize({ server });
|
|
|
|
|
2022-02-08 17:30:42 +00:00
|
|
|
// General conversation send queue
|
2022-02-16 18:36:21 +00:00
|
|
|
conversationJobQueue.streamJobs();
|
2022-02-08 17:30:42 +00:00
|
|
|
|
|
|
|
// Single proto send queue, used for a variety of one-off simple messages
|
|
|
|
singleProtoJobQueue.streamJobs();
|
|
|
|
|
|
|
|
// Syncs to others
|
|
|
|
deliveryReceiptsJobQueue.streamJobs();
|
2021-12-07 22:41:40 +00:00
|
|
|
readReceiptsJobQueue.streamJobs();
|
2022-02-08 17:30:42 +00:00
|
|
|
viewedReceiptsJobQueue.streamJobs();
|
|
|
|
|
|
|
|
// Syncs to ourselves
|
2021-07-23 22:02:36 +00:00
|
|
|
readSyncJobQueue.streamJobs();
|
2022-02-08 17:30:42 +00:00
|
|
|
viewSyncJobQueue.streamJobs();
|
2022-02-22 20:34:57 +00:00
|
|
|
viewOnceOpenJobQueue.streamJobs();
|
2022-02-08 17:30:42 +00:00
|
|
|
|
|
|
|
// Other queues
|
2021-04-29 23:02:27 +00:00
|
|
|
removeStorageKeyJobQueue.streamJobs();
|
2021-05-27 20:17:05 +00:00
|
|
|
reportSpamJobQueue.streamJobs();
|
2021-04-29 23:02:27 +00:00
|
|
|
}
|