(user: Api.User)
| 244 | parts.push(`<code>${htmlEscape(user.username)}</code>`); |
| 245 | } |
| 246 | parts.push(`<a href="tg://user?id=${userId}">${userId}</a>`); |
| 247 | |
| 248 | return parts.join(" "); |
| 249 | } |
| 250 | |
| 251 | function buildUserDisplayFromId(userId: string): string { |
| 252 | return `<a href="tg://user?id=${userId}">${htmlEscape(userId)}</a>`; |
| 253 | } |
| 254 | |
| 255 | function buildUserDisplayFromCache( |
| 256 | userId: string, |
| 257 | cachedUser?: { name?: string; username?: string | null }, |
| 258 | ): string { |
| 259 | if (!cachedUser) { |
| 260 | return buildUserDisplayFromId(userId); |
| 261 | } |
| 262 | |
| 263 | const parts: string[] = []; |
| 264 | const displayName = (cachedUser.name || "").trim(); |
no test coverage detected