Sync group stories through storage service
This commit is contained in:
parent
a711ae1c49
commit
95bee1c881
15 changed files with 355 additions and 157 deletions
23
ts/util/isGroupInStoryMode.ts
Normal file
23
ts/util/isGroupInStoryMode.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue