Skip to content

Commit

Permalink
Improve message links of public chats
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Jun 10, 2024
1 parent 8a6bc8a commit b9b6c37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/4_message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,9 @@ export async function constructMessage(
const entity = await getEntity(message_.peer_id);
if (entity) {
chat_ = constructChatP(entity);
if (chat_.username) {
link = link.replace(`/c/${message_.peer_id.channel_id}/`, `/${chat_.username}/`);
}
} else {
unreachable();
}
Expand Down

0 comments on commit b9b6c37

Please sign in to comment.