Notify story creator for replies

This commit is contained in:
Jamie Kyle 2022-10-11 10:59:02 -07:00 committed by GitHub
parent 512d655d32
commit 25bc16300c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 250 additions and 135 deletions

View file

@ -154,6 +154,7 @@ import { SeenStatus } from './MessageSeenStatus';
import MessageSender from './textsecure/SendMessage';
import type AccountManager from './textsecure/AccountManager';
import { onStoryRecipientUpdate } from './util/onStoryRecipientUpdate';
import { StoryViewModeType, StoryViewTargetType } from './types/Stories';
const MAX_ATTACHMENT_DOWNLOAD_AGE = 3600 * 72 * 1000;
@ -1879,10 +1880,19 @@ export async function startApp(): Promise<void> {
activeWindowService.registerForActive(() => notificationService.clear());
window.addEventListener('unload', () => notificationService.fastClear());
notificationService.on('click', (id, messageId) => {
notificationService.on('click', (id, messageId, storyId) => {
window.showWindow();
if (id) {
window.Whisper.events.trigger('showConversation', id, messageId);
if (storyId) {
window.reduxActions.stories.viewStory({
storyId,
storyViewMode: StoryViewModeType.Single,
viewTarget: StoryViewTargetType.Replies,
});
} else {
window.Whisper.events.trigger('showConversation', id, messageId);
}
} else {
window.reduxActions.app.openInbox();
}