Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/push/send.js
Show All 17 Lines | import { | ||||
createMessageInfo, | createMessageInfo, | ||||
shimUnsupportedRawMessageInfos, | shimUnsupportedRawMessageInfos, | ||||
sortMessageInfoList, | sortMessageInfoList, | ||||
} from 'lib/shared/message-utils.js'; | } from 'lib/shared/message-utils.js'; | ||||
import { messageSpecs } from 'lib/shared/messages/message-specs.js'; | import { messageSpecs } from 'lib/shared/messages/message-specs.js'; | ||||
import { notifTextsForMessageInfo } from 'lib/shared/notif-utils.js'; | import { notifTextsForMessageInfo } from 'lib/shared/notif-utils.js'; | ||||
import { | import { | ||||
rawThreadInfoFromServerThreadInfo, | rawThreadInfoFromServerThreadInfo, | ||||
threadInfoFromRawThreadInfo, | serverThreadInfoFromRawThreadInfo, | ||||
} from 'lib/shared/thread-utils.js'; | } from 'lib/shared/thread-utils.js'; | ||||
import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; | import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; | ||||
import type { Platform, PlatformDetails } from 'lib/types/device-types.js'; | import type { Platform, PlatformDetails } from 'lib/types/device-types.js'; | ||||
import { messageTypes } from 'lib/types/message-types-enum.js'; | import { messageTypes } from 'lib/types/message-types-enum.js'; | ||||
import { | import { | ||||
type MessageData, | type MessageData, | ||||
type RawMessageInfo, | type RawMessageInfo, | ||||
rawMessageInfoValidator, | rawMessageInfoValidator, | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | const threadInfos = _flow( | ||||
if (!rawThreadInfo) { | if (!rawThreadInfo) { | ||||
return null; | return null; | ||||
} | } | ||||
invariant( | invariant( | ||||
rawThreadInfo.minimallyEncoded, | rawThreadInfo.minimallyEncoded, | ||||
'rawThreadInfo from rawThreadInfoFromServerThreadInfo must be ' + | 'rawThreadInfo from rawThreadInfoFromServerThreadInfo must be ' + | ||||
'minimallyEncoded when minimallyEncodePermissions option is set', | 'minimallyEncoded when minimallyEncodePermissions option is set', | ||||
); | ); | ||||
return threadInfoFromRawThreadInfo(rawThreadInfo, userID, userInfos); | return serverThreadInfoFromRawThreadInfo( | ||||
rawThreadInfo, | |||||
userID, | |||||
userInfos, | |||||
); | |||||
}), | }), | ||||
_pickBy(threadInfo => threadInfo), | _pickBy(threadInfo => threadInfo), | ||||
)(serverThreadInfos); | )(serverThreadInfos); | ||||
for (const notifInfo of usersToCollapsableNotifInfo[userID]) { | for (const notifInfo of usersToCollapsableNotifInfo[userID]) { | ||||
preparePromises.push( | preparePromises.push( | ||||
preparePushNotif({ | preparePushNotif({ | ||||
keyserverID, | keyserverID, | ||||
notifInfo, | notifInfo, | ||||
▲ Show 20 Lines • Show All 1,678 Lines • Show Last 20 Lines |