Additional work to include story=true on send

This commit is contained in:
Scott Nonnenberg 2022-10-07 10:02:08 -07:00 committed by GitHub
parent 3bfeffe502
commit 4ec48df5b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 327 additions and 170 deletions

View file

@ -8,7 +8,7 @@ import type { UUIDStringType } from '../types/UUID';
import * as log from '../logging/log';
import dataInterface from '../sql/Client';
import { DAY, SECOND } from './durations';
import { MY_STORIES_ID } from '../types/Stories';
import { getStoriesBlocked, MY_STORIES_ID } from '../types/Stories';
import { ReadStatus } from '../messages/MessageReadStatus';
import { SeenStatus } from '../MessageSeenStatus';
import { SendStatus } from '../messages/MessageSendState';
@ -28,10 +28,17 @@ export async function sendStoryMessage(
conversationIds: Array<string>,
attachment: AttachmentType
): Promise<void> {
if (getStoriesBlocked()) {
log.warn('stories.sendStoryMessage: stories disabled, returning early');
return;
}
const { messaging } = window.textsecure;
if (!messaging) {
log.warn('stories.sendStoryMessage: messaging not available');
log.warn(
'stories.sendStoryMessage: messaging not available, returning early'
);
return;
}