(messageIds: number[])
| 217 | return `<a href="${htmlEscape(startLink)}">${start}</a>-<a href="${htmlEscape(endLink)}">${end}</a>`; |
| 218 | } |
| 219 | |
| 220 | private async getChatDisplayName(chatId: string): Promise<string> { |
| 221 | const cachedName = this.chatDisplayNameCache.get(chatId); |
| 222 | if (cachedName) { |
| 223 | return cachedName; |
| 224 | } |
| 225 | |
| 226 | try { |
| 227 | const client = await getGlobalClient(); |
| 228 | const peer: Peer = await client.getPeer(chatId); |
| 229 | |
| 230 | const title = |
| 231 | peer.type === 'chat' |
| 232 | ? (peer as Chat).title |
| 233 | : [(peer as User).firstName, (peer as User).lastName].filter(Boolean).join(' ').trim() || (peer as User).username; |
| 234 | |
| 235 | const resolvedName = title ? String(title) : chatId; |
| 236 | this.chatDisplayNameCache.set(chatId, resolvedName); |
| 237 | return resolvedName; |
| 238 | } catch { |
| 239 | this.chatDisplayNameCache.set(chatId, chatId); |
| 240 | return chatId; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | private async sendSingleSourceMessage( |
| 245 | targetPeer: InputPeerLike, |
no outgoing calls
no test coverage detected