Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar committed Mar 25, 2024
1 parent 6b54af0 commit 4b235de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mautrix_telegram/portal_util/message_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ def _caption_to_message(converted: ConvertedMessage) -> None:
content["format"] = Format.HTML.value

def _get_external_url(self, evt: Message) -> str | None:
if self.portal.peer_type == "channel" and self.portal.username is not None:
return f"https://t.me/{self.portal.username}/{evt.id}"
elif self.portal.peer_type != "user":
if self.portal.peer_type == "chat":
return f"https://t.me/c/{self.portal.tgid}/{evt.id}"
if self.portal.username is not None:
return f"https://t.me/{self.portal.username}/{evt.id}"
return None

@staticmethod
Expand Down

0 comments on commit 4b235de

Please sign in to comment.