tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.07k stars 1.44k forks source link

Telegram doesn't detect if Telegram client is logged on #1260

Closed codinghedgehog-python closed 3 years ago

codinghedgehog-python commented 3 years ago

I'm using Ubuntu Touch phone and I requested to export my chats. For security reasons the system needs user to confirm it from desktop and also from phone. On desktop it's fine but when I tried to confirm the request from Ubuntu Touch phone (think Teleports) it didn't detect my log on on mobile device.

levlam commented 3 years ago

I don't understand, what confirmation you are talking about.

codinghedgehog-python commented 3 years ago

When you make a request to export your data and chats in Telegram it will prompt you to confirm it on your desktop app and also on mobile app. As of now you can confirm it on desktop app but if you're using Teleports which is Telegram client it won't detect it as a mobile app and doesn't show the prompt to confirm.

Here's the prompt I'm talking about https://www.dropbox.com/s/6bk493av13exob2/imageedit_1_3632357727.png?raw=1

levlam commented 3 years ago

You should be able to press "Allow" button from any other client, which is logged for more than 24 hours. There should be no issues in allowing the immediate export using Teleports. What error do you receive?

codinghedgehog-python commented 3 years ago

@levlam I'm not getting any errors. There's simply nothing to confirm. Even when I'm logged into Teleports I still see the message telling me I need to either confirm the export from 2 recent devices or wait 24 hours for export to happen. Meaning ... it doesn't know that I'm reading it on the phone.

levlam commented 3 years ago

There are no such checks as "reading it on the phone". You can confirm immediate export from any other device logged in for more than 24 hours, despite the message calls such devices "mobile".

codinghedgehog-python commented 3 years ago

All I'm really saying is that if I wasn't able to confirm the prompt on Teleports on Ubuntu Touch phone. Chances are someone else in my situation won't be either. Besides I checked the settings in Teleports and didn't see the option to export data anywhere.

levlam commented 3 years ago

You can export data only from Telegram Desktop. To start immediate export, you can allow it from any other device by pressing Allow button. What happens when you press "Allow" button on Teleports?

codinghedgehog-python commented 3 years ago

There's nothing to press. There's no prompt that's what I'm trying to tell you.

codinghedgehog-python commented 3 years ago

This is easily reproducible. Go into Telegram Desktop app and request data export. When it asks you to confirm the export on your UT phone you'll see for yourself.

levlam commented 3 years ago

If the button isn't shown under the message, then this is likely a Teleport's fault. The buttons are ordinary inline buttons, used by bots. For example, can you see inline buttons under the post https://t.me/BotNews/16 in Teleports?

codinghedgehog-python commented 3 years ago

So sorry then. They told me to file an issue here.

levlam commented 3 years ago

If you see buttons under https://t.me/BotNews/16, then the problem is somewhere else. If not, then the problem is in Teleports not showing inline buttons.

Flohack74 commented 3 years ago

Let me jump in: I sent @codinghedgehog-python here because I had no idea whats the mechanism behind the scenes. If this confirmation is made with a bot keyboard, then yes, it cannot work with TELEports, we do not have bot keyboards visible right now. So the question was just, is this a separate event message in tdlib, or one thats not implemented. If its transparent for tdlib you can close here ;)

Flohack74 commented 3 years ago

Just one more question @levlam in which chat should this keyboard appear? Is it the Telegram system chat where we also get logon notifications from new devices etc.?

levlam commented 3 years ago

@Flohack74 Those are ordinary callback buttons in an inline keyboard.

The exact chat, in which Telegram sends the notification, can be changed in the future, but given the buttons are ordinary buttons, they don't need unusual handling and can be shown in any chat.