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

Function getThreadTypeParentRequirement

lib/shared/thread-utils.js:1257–1279  ·  view source on GitHub ↗
(
  threadType: ThinThreadType,
)

Source from the content-addressed store, hash-verified

1255type ThreadTypeParentRequirement = 'optional' | 'required' | 'disabled';
1256
1257function getThreadTypeParentRequirement(
1258 threadType: ThinThreadType,
1259): ThreadTypeParentRequirement {
1260 if (
1261 threadType === threadTypes.COMMUNITY_OPEN_SUBTHREAD ||
1262 threadType === threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD ||
1263 //threadType === threadTypes.COMMUNITY_SECRET_SUBTHREAD ||
1264 threadType === threadTypes.COMMUNITY_SECRET_ANNOUNCEMENT_SUBTHREAD ||
1265 threadTypeIsSidebar(threadType)
1266 ) {
1267 return 'required';
1268 } else if (
1269 threadType === threadTypes.COMMUNITY_ROOT ||
1270 threadType === threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT ||
1271 threadType === threadTypes.GENESIS ||
1272 threadType === threadTypes.GENESIS_PERSONAL ||
1273 threadType === threadTypes.GENESIS_PRIVATE
1274 ) {
1275 return 'disabled';
1276 } else {
1277 return 'optional';
1278 }
1279}
1280
1281function checkIfDefaultMembersAreVoiced(threadInfo: ThreadInfo): boolean {
1282 const defaultRoleID = Object.keys(threadInfo.roles).find(roleID =>

Callers 2

createThreadFunction · 0.90
updateThreadFunction · 0.90

Calls 1

threadTypeIsSidebarFunction · 0.90

Tested by

no test coverage detected