MCPcopy Create free account
hub / github.com/CommE2E/comm / getContainingThreadID

Function getContainingThreadID

lib/shared/thread-utils.js:1302–1320  ·  view source on GitHub ↗
(
  parentThreadInfo:
    | ?ServerThreadInfo
    | LegacyRawThreadInfo
    | RawThreadInfo
    | ThreadInfo,
  threadType: ThreadType,
)

Source from the content-addressed store, hash-verified

1300}
1301
1302function getContainingThreadID(
1303 parentThreadInfo:
1304 | ?ServerThreadInfo
1305 | LegacyRawThreadInfo
1306 | RawThreadInfo
1307 | ThreadInfo,
1308 threadType: ThreadType,
1309): ?string {
1310 if (!parentThreadInfo) {
1311 return null;
1312 }
1313 if (threadTypeIsSidebar(threadType)) {
1314 return parentThreadInfo.id;
1315 }
1316 if (!parentThreadInfo.containingThreadID) {
1317 return parentThreadInfo.id;
1318 }
1319 return parentThreadInfo.containingThreadID;
1320}
1321
1322function getCommunity(
1323 threadInfo:

Callers 6

determineThreadAncestryFunction · 0.90
usePotentialMemberItemsFunction · 0.90
persist.jsFile · 0.90

Calls 1

threadTypeIsSidebarFunction · 0.90

Tested by

no test coverage detected