telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.81k stars 5.11k forks source link

[Feature Request] Deep Link for Opening Profile, Like Android #8825

Open PhardAlef opened 3 years ago

PhardAlef commented 3 years ago

Like Android and iOS tg://openmessage?user_id=142364654 t.me/@id142364654 opens the profile of person, having group/chat in common (or going directly to a private message, by including message id too)

MasterGroosha commented 3 years ago

t.me/@id1234567 links don't work on Android too (edit: but works on iOS)

M299792458 commented 3 years ago

It's now available in TD x64: https://t.me/tg_x64/166 Make a pr.

zarEclEC commented 3 years ago

Following @M299792458 advice, I made a PR based on https://github.com/TDesktop-x64, cherrypicking the commits

16124

MKRhere commented 1 year ago

@john-preston from the PR

A link to a specific message is even a more strange feature. You can't know any valid message id in someone else inbox, and you have no way of getting a message id or user id in any of the official apps

There is one usecase here; bots can know message IDs from their private chats and the user's chat ID. Bots can create links to messages in their private chat with the user.

it will or won't work depending on did you or did you not see this user (in a group or in chats list) in this exact session.

If that's the limitation, we just have to live with that limitation then.

john-preston commented 1 year ago

@MKRhere well, sent inline result's message ids are not supposed to be relied on as real inbox message ids and nobody promises anywhere in docs that those ids are going to match, so this is not a supported use case anyway. They are supposed to be used only from the bots side in his internal process.

MKRhere commented 1 year ago

@john-preston I'm not talking about inline query result. I'm talking about the bot's private chat.

(I had a user ask for this in the Telegraf bot framework's support chat, which is why I ask.)

john-preston commented 1 year ago

@MKRhere Hmm. How do you get message id in users inbox in bot's private chats on bot's side?

MKRhere commented 1 year ago

For messages from the user, we receive the message update, and we're able to access: update.chat.id and update.message.message_id.

For messages sent by the bot, as a response to sendMessage, similar to:

const message = telegram.sendMessage({ chatId, text });
message.message_id;
john-preston commented 1 year ago

@MKRhere This is message_id in the bots messages box, not the message_id in users messages box. As with chats between users the message_ids for one private chat party is unrelated to message_ids for the second party.

john-preston commented 1 year ago

@MKRhere Each user has his messages box ids start with 1 (I think, or smth like that), so if you take several different users, each of whom just joined Telegram, opened chat with the bot and sent him a "/start" message, for every user this message will have ID = 1, while for the bot the message_ids of those messages would be different.