( threadType: ThreadType, memberIDs: $ReadOnlyArray<string>, sourceMessageID: ?string, protocol?: ?ProtocolName, )
| 390 | } |
| 391 | |
| 392 | function getPendingThreadID( |
| 393 | threadType: ThreadType, |
| 394 | memberIDs: $ReadOnlyArray<string>, |
| 395 | sourceMessageID: ?string, |
| 396 | protocol?: ?ProtocolName, |
| 397 | ): string { |
| 398 | let pendingThreadKey; |
| 399 | if (sourceMessageID) { |
| 400 | const config = threadSpecs[threadType].protocol().sidebarConfig; |
| 401 | invariant(config, `Thread type ${threadType} doesn't support sidebars`); |
| 402 | const prefix = config.pendingSidebarURLPrefix; |
| 403 | pendingThreadKey = `${prefix}/${sourceMessageID}`; |
| 404 | } else { |
| 405 | pendingThreadKey = [...memberIDs].sort().join('+'); |
| 406 | } |
| 407 | |
| 408 | const pendingThreadTypeString = sourceMessageID ? '' : `type${threadType}/`; |
| 409 | const pendingThreadProtocolString = protocol ? `/protocol_${protocol}` : ''; |
| 410 | return `pending/${pendingThreadTypeString}${pendingThreadKey}${pendingThreadProtocolString}`; |
| 411 | } |
| 412 | |
| 413 | type PendingThreadIDContents = { |
| 414 | +threadType: ThreadType, |
no outgoing calls
no test coverage detected