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

Function threadNoun

lib/shared/thread-utils.js:1112–1133  ·  view source on GitHub ↗
(threadType: ThreadType, parentThreadID: ?string)

Source from the content-addressed store, hash-verified

1110 `To move a chat over here, switch the “Muted” option in its settings.`;
1111
1112function threadNoun(threadType: ThreadType, parentThreadID: ?string): string {
1113 if (threadTypeIsSidebar(threadType)) {
1114 return 'thread';
1115 } else if (
1116 threadType === threadTypes.COMMUNITY_SECRET_SUBTHREAD &&
1117 parentThreadID === genesis().id
1118 ) {
1119 return 'chat';
1120 } else if (
1121 threadType === threadTypes.COMMUNITY_ROOT ||
1122 threadType === threadTypes.COMMUNITY_ANNOUNCEMENT_ROOT ||
1123 threadType === threadTypes.COMMUNITY_OPEN_SUBTHREAD ||
1124 threadType === threadTypes.COMMUNITY_OPEN_ANNOUNCEMENT_SUBTHREAD ||
1125 threadType === threadTypes.COMMUNITY_SECRET_SUBTHREAD ||
1126 threadType === threadTypes.COMMUNITY_SECRET_ANNOUNCEMENT_SUBTHREAD ||
1127 threadType === threadTypes.GENESIS
1128 ) {
1129 return 'channel';
1130 } else {
1131 return 'chat';
1132 }
1133}
1134
1135function threadLabel(threadType: ThreadType): string {
1136 return threadSpecs[threadType].threadLabel;

Callers 4

getNameForThreadEntityFunction · 0.90
notificationTextsFunction · 0.90
communityOrThreadNounFunction · 0.85

Calls 2

threadTypeIsSidebarFunction · 0.90
genesisFunction · 0.85

Tested by

no test coverage detected