Changeset View
Changeset View
Standalone View
Standalone View
lib/shared/messages/sidebar-source-message-spec.js
// @flow | // @flow | ||||
import invariant from 'invariant'; | import invariant from 'invariant'; | ||||
import type { | import { | ||||
CreateMessageInfoParams, | pushTypes, | ||||
MessageSpec, | type CreateMessageInfoParams, | ||||
NotificationTextsParams, | type MessageSpec, | ||||
RawMessageInfoFromServerDBRowParams, | type NotificationTextsParams, | ||||
type RawMessageInfoFromServerDBRowParams, | |||||
} from './message-spec.js'; | } from './message-spec.js'; | ||||
import { assertSingleMessageInfo } from './utils.js'; | import { assertSingleMessageInfo, joinResult } from './utils.js'; | ||||
import type { PlatformDetails } from '../../types/device-types.js'; | import type { PlatformDetails } from '../../types/device-types.js'; | ||||
import type { | import type { | ||||
MessageInfo, | MessageInfo, | ||||
RawSidebarSourceMessageInfo, | RawSidebarSourceMessageInfo, | ||||
SidebarSourceMessageData, | SidebarSourceMessageData, | ||||
SidebarSourceMessageInfo, | SidebarSourceMessageInfo, | ||||
ClientDBMessageInfo, | ClientDBMessageInfo, | ||||
} from '../../types/message-types.js'; | } from '../../types/message-types.js'; | ||||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | ): Promise<NotifTexts> { | ||||
invariant( | invariant( | ||||
messageInfo.type === messageTypes.SIDEBAR_SOURCE, | messageInfo.type === messageTypes.SIDEBAR_SOURCE, | ||||
'messageInfo should be messageTypes.SIDEBAR_SOURCE!', | 'messageInfo should be messageTypes.SIDEBAR_SOURCE!', | ||||
); | ); | ||||
const sourceMessageInfo = messageInfo.sourceMessage; | const sourceMessageInfo = messageInfo.sourceMessage; | ||||
return await params.notificationTexts([sourceMessageInfo], threadInfo); | return await params.notificationTexts([sourceMessageInfo], threadInfo); | ||||
}, | }, | ||||
generatesNotifs: async () => undefined, | notificationCollapseKey(rawMessageInfo: RawSidebarSourceMessageInfo): string { | ||||
return joinResult(messageTypes.CREATE_SIDEBAR, rawMessageInfo.threadID); | |||||
}, | |||||
generatesNotifs: async () => pushTypes.NOTIF, | |||||
startsThread: true, | startsThread: true, | ||||
}); | }); |