diff --git a/keyserver/src/fetchers/message-fetchers.js b/keyserver/src/fetchers/message-fetchers.js --- a/keyserver/src/fetchers/message-fetchers.js +++ b/keyserver/src/fetchers/message-fetchers.js @@ -6,6 +6,7 @@ sortMessageInfoList, shimUnsupportedRawMessageInfos, isInvalidSidebarSource, + isUnableToBeRenderedOnItsOwn, } from 'lib/shared/message-utils.js'; import { messageSpecs } from 'lib/shared/messages/message-specs.js'; import { getNotifCollapseKey } from 'lib/shared/notif-utils.js'; @@ -890,10 +891,11 @@ >(); for (const message of parsedResults) { const { rawMessageInfo } = message; - if (isInvalidSidebarSource(rawMessageInfo)) { + if (isUnableToBeRenderedOnItsOwn(rawMessageInfo)) { continue; } invariant(rawMessageInfo.id, 'rawMessageInfo.id should not be null'); + // $FlowFixMe rawMessageInfoMap.set(rawMessageInfo.id, rawMessageInfo); } diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js --- a/lib/shared/message-utils.js +++ b/lib/shared/message-utils.js @@ -671,6 +671,12 @@ return !messageSpecs[message.type].canBePinned; } +function isUnableToBeRenderedOnItsOwn( + message: RawMessageInfo | MessageInfo, +): boolean { + return !messageSpecs[message.type].canBeRenderedOnItsOwn; +} + export { localIDPrefix, messageKey, @@ -702,4 +708,5 @@ useNextLocalID, isInvalidSidebarSource, isInvalidPinSource, + isUnableToBeRenderedOnItsOwn, };