diff --git a/lib/utils/entity-text.js b/lib/utils/entity-text.js --- a/lib/utils/entity-text.js +++ b/lib/utils/entity-text.js @@ -213,7 +213,6 @@ function getNameForThreadEntity( entity: ThreadEntity, - threadID: ?string, params?: ?EntityTextToRawStringParams, ): string { const { name: userGeneratedName, display } = entity; @@ -243,7 +242,7 @@ if (!name || entity.alwaysDisplayShortName) { const threadType = entity.threadType ?? threadTypes.PERSONAL; const noun = entity.subchannel ? 'subchannel' : threadNoun(threadType); - if (entity.id === threadID) { + if (entity.id === params?.threadID) { const prefixThisThreadNounWith = params?.prefixThisThreadNounWith === 'your' ? 'your' : 'this'; name = `${prefixThisThreadNounWith} ${noun}`; @@ -283,7 +282,7 @@ if (typeof entity === 'string') { return entity; } else if (entity.type === 'thread') { - return getNameForThreadEntity(entity, params?.threadID, params); + return getNameForThreadEntity(entity, params); } else if (entity.type === 'color') { return entity.hex; } else if (entity.type === 'user') { @@ -319,7 +318,7 @@ ); } else if (entity.type === 'thread') { const { id } = entity; - const name = getNameForThreadEntity(entity, threadID); + const name = getNameForThreadEntity(entity, { threadID }); if (id === threadID) { return name; } else {