Changeset View
Changeset View
Standalone View
Standalone View
lib/shared/markdown.js
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | |||||
function parseChatMention( | function parseChatMention( | ||||
chatMentionCandidates: ChatMentionCandidates, | chatMentionCandidates: ChatMentionCandidates, | ||||
capture: Capture, | capture: Capture, | ||||
): { | ): { | ||||
threadInfo: ?ResolvedThreadInfo, | threadInfo: ?ResolvedThreadInfo, | ||||
content: string, | content: string, | ||||
hasAccessToChat: boolean, | hasAccessToChat: boolean, | ||||
} { | } { | ||||
const threadInfo = chatMentionCandidates[capture[3]]; | const chatMentionCandidate = chatMentionCandidates[capture[3]]; | ||||
const threadInfo = chatMentionCandidate?.threadInfo; | |||||
const threadName = threadInfo?.uiName ?? decodeChatMentionText(capture[4]); | const threadName = threadInfo?.uiName ?? decodeChatMentionText(capture[4]); | ||||
const content = `${capture[1]}@${threadName}`; | const content = `${capture[1]}@${threadName}`; | ||||
return { | return { | ||||
threadInfo, | threadInfo, | ||||
content, | content, | ||||
hasAccessToChat: !!threadInfo, | hasAccessToChat: !!threadInfo, | ||||
}; | }; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |