[Sources] Accept a t.me link and auto-extract the chat id #4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current behaviour
In the Sources form, the "Telegram chat" field (
sources.html, "Add source" dialog) only accepts either an@usernameor a numeric chat id as free text. The value is stored as-is inSource.telegram_chat(create_sourceroute,app/main.py:1042) and later passed to_resolve_chat(app/telegram/indexer.py:47), which only understands@usernameor a digit-only value. There is no automatic extraction of the numeric chat id from at.me/...link, and a pastedt.me/...URL is not handled specially.Desired behaviour
Allow pasting a
t.melink (e.g.https://t.me/somechannel,https://t.me/+invitecode) in the Sources form and have the app automatically resolve and extract the numeric Telegram chat id, so the source is stored and indexed with the correct chat regardless of whether the input is a link, a username or a raw id.Goals
t.me/...link in the "Telegram chat" field and normalize/detect it._resolve_chat/ the source creation/index flow so link-format input resolves to the real chat that the account has access to).Source.telegram_chatso indexing, thumbnails and message URLs work consistently.@usernameand numeric-id sources; update the placeholder in the Sources dialog accordingly.