Open DopeforHope opened 4 years ago
So investigated again the bug. The point is the following: I have the telegram-cli open for both and currently executing the commands manually. Clients wo want to establish a secret chat:
> create_secret_chat Yomam_Whkart
{"event": "updates", "peer": {"id": "$04000000cdd05343f5d10609edb50096", "peer_type": "encr_chat", "peer_id": 1129566413, "print_name": "!_Yomam_Whkart", "flags": 1, "user": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}}, "updates": []}
{"id": "$04000000cdd05343f5d10609edb50096", "peer_type": "encr_chat", "peer_id": 1129566413, "print_name": "!_Yomam_Whkart", "flags": 1, "user": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}}
{"event": "updates", "peer": {"id": "$04000000cdd05343f5d10609edb50096", "peer_type": "encr_chat", "peer_id": 1129566413, "print_name": "!_Yomam_Whkart", "flags": 1, "user": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}}, "updates": ["working"]}
{"event": "service", "id": "04000000cdd05343cfbda28e150a412ff5d10609edb50096", "flags": 10499, "from": {"id": "$01000000a3ed432e97cab7e200c94ff4", "peer_type": "user", "peer_id": 776203683, "print_name": "Evelyn", "flags": 524289, "first_name": "Evelyn", "when": "2020-01-03 18:12:17", "last_name": "", "phone": "4915129595268"}, "to": {"id": "$04000000cdd05343f5d10609edb50096", "peer_type": "encr_chat", "peer_id": 1129566413, "print_name": "!_Yomam_Whkart", "flags": 1, "user": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}}, "out": true, "unread": true, "service": true, "date": 1578157822, "action": {"type": "notify_layer", "layer": 17}}
*** 1578157822.561615 qts = 48081268, qts_count = 1
{"event": "service", "id": "04000000cdd05343b6dccdce7aa42714f5d10609edb50096", "flags": 10496, "from": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}, "to": {"id": "$04000000cdd05343f5d10609edb50096", "peer_type": "encr_chat", "peer_id": 1129566413, "print_name": "!_Yomam_Whkart", "flags": 1, "user": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}}, "out": false, "unread": false, "service": true, "date": 1578157822, "action": {"type": "notify_layer", "layer": 17}}
{"user": {"id": "$010000009e5c453134338a86754f1792", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}, "online": false, "state": -1, "when": "2020-01-04 18:14:32", "event": "online-status"}
> msg !_Yomam_Whkart "Secret chat works"
{"event": "message", "id": "04000000cdd05343d6d7b6990d756744f5d10609edb50096", "flags": 18691, "from": {"id": "$01000000a3ed432e97cab7e200c94ff4", "peer_type": "user", "peer_id": 776203683, "print_name": "Evelyn", "flags": 524289, "first_name": "Evelyn", "when": "2020-01-03 18:12:17", "last_name": "", "phone": "4915129595268"}, "to": {"id": "$04000000cdd05343f5d10609edb50096", "peer_type": "encr_chat", "peer_id": 1129566413, "print_name": "!_Yomam_Whkart", "flags": 1, "user": {"id": "$010000009e5c45310000000000000000", "peer_type": "user", "peer_id": 826629278, "print_name": "Yomam_Whkart", "flags": 196609, "first_name": "Yomam", "when": "2020-01-04 18:14:32", "last_name": "Whkart", "phone": "4915129595269"}}, "out": true, "unread": true, "service": false, "date": 1578158234, "text": "Secret chat works"}
{"result": "SUCCESS"}
And the other side who accepts the chat automatically:
{"result": "SUCCESS"}
*** 1578157822.563992 qts = 210302461, qts_count = 1
*** 1578158234.395456 qts = 210302462, qts_count = 1
So only the other side receives the success message. Nevertheless it seems that the secret doesn't even work reliably with telegram-cli.
The problem
Result parser for secret chats raises exception due to expected result in JSON Therefore secret chats cant be used. When doing by hand the success msg comes one later. I added a print of the JSON for debugging purposes.
Your environment
Fill out your used versions:
Python 2.7.15+
0.4.10
Linux pop-os 5.3.0-22-generic
1.4.1
Things to check before submitting a report
Have you
Steps to reproduce
Use
sender.create_secret_chat
with the username as argument.Expected behaviour
Don't raise an execption.
Actual behaviour
Programm: