Sync group stories through storage service

This commit is contained in:
Fedor Indutny 2022-10-07 17:19:02 -07:00 committed by GitHub
parent a711ae1c49
commit 95bee1c881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 355 additions and 157 deletions

View file

@ -0,0 +1,23 @@
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationType } from '../state/ducks/conversations';
import { StorySendMode } from '../types/Stories';
import { assertDev } from './assert';
export function isGroupInStoryMode(
{ id, type, storySendMode }: ConversationType,
conversationIdsWithStories: Set<string>
): boolean {
if (type !== 'group') {
return false;
}
assertDev(
storySendMode !== undefined,
'isGroupInStoryMode: groups must have storySendMode field'
);
if (storySendMode === StorySendMode.IfActive) {
return conversationIdsWithStories.has(id);
}
return storySendMode === StorySendMode.Always;
}