Commit Graph

1374 Commits

Author SHA1 Message Date
Lonami Exo
ac567ebf1d Handle bad salt/msg not resending containers 2018-10-05 13:26:44 +02:00
Lonami Exo
3b1142aaca Add back auth key generation process 2018-10-05 13:26:44 +02:00
Lonami Exo
5edc2216c7 Handle initial connection if network is down correctly 2018-10-05 13:26:44 +02:00
Lonami Exo
2d275989cb Properly handle cancellation in _ReadyQueue 2018-10-05 13:26:44 +02:00
Lonami Exo
105bd52eee Abstract the send queue off MTProtoSender 2018-10-05 13:26:44 +02:00
Lonami Exo
b02ebcb69b Stop waiting for send items on disconnection 2018-10-05 13:26:44 +02:00
Lonami Exo
470fb9f5df Make use of the MTProtoLayer in MTProtoSender 2018-10-05 13:26:44 +02:00
Lonami Exo
9402b4a26d Create a new layer to lift encryption off the MTProtoSender 2018-10-05 13:26:44 +02:00
Lonami Exo
5daad2aaab Actually use the new connection class 2018-10-05 13:26:44 +02:00
Lonami Exo
daf94e416b Fix connection never receiving and missing clone method 2018-10-05 13:26:44 +02:00
Lonami Exo
2fd51b8582 Let all connection modes implement the new Connection 2018-10-05 13:26:44 +02:00
Lonami Exo
096424ea78 Create a new Connection class to work through queues 2018-10-05 13:26:44 +02:00
painor
340f5614b5 Add name mention formatting to HTML and Markdown (#1019) 2018-10-04 15:56:32 +02:00
Manuel1510
2468b32fc5 Implement next_offset and allow empty results in answer() (#1017) 2018-10-04 09:12:12 +02:00
nailerNAS
c2966297f1 Add delete method to custom.Dialog (#1014) 2018-09-28 15:47:24 +02:00
Lonami Exo
785071a5cd Update to v1.3 2018-09-22 19:37:16 +02:00
Lonami Exo
ec0aa65fe1 An user -> a user 2018-09-22 19:18:42 +02:00
Lonami Exo
d5d3733fd4 Create events.register and siblings for "handler templates"
This can be thought of as a different approach to Flask's blueprints.
2018-09-22 12:51:58 +02:00
Lonami Exo
cb6f980277 Better autocast to InputPeerDialog and documentation 2018-09-22 10:56:37 +02:00
Lonami Exo
92c9bb12b7 Use asyncio.open_connection in the TcpClient
(cherry picked from commit 573fed1f512831cd9790130cc878655fef2fde98)
2018-09-19 19:03:36 +02:00
Lonami Exo
9275a9fcbb Fix several typos and misleading docs (#987, #990) 2018-09-19 17:51:18 +02:00
Lonami Exo
5e13a6f7a8 Fix-up get_message failing for UpdateInlineBotCallbackQuery 2018-09-19 16:42:22 +02:00
Lonami Exo
ac59cfa25b Return chat from inline queries that "don't have it" 2018-09-19 16:40:35 +02:00
udf
3ef2416138 Add method to resolve inline message IDs (#1005) 2018-09-19 14:22:35 +02:00
Lonami Exo
db8bea3968 Fix getting messages by ID for private chats 2018-09-16 15:45:38 +02:00
Lonami Exo
4e07712b04 Return new .web_preview's .photo/.document if present in Message 2018-09-15 10:45:15 +02:00
Lonami Exo
080585da49 Support coroutine callbacks in start() 2018-09-09 16:17:20 +02:00
Lonami Exo
2f09e5c335 Support custom-callback filter for all events 2018-09-09 15:48:54 +02:00
Lonami Exo
11ef4ce370 Fix _document_by_attribute failing on empty media 2018-09-06 15:41:04 +02:00
Lonami Exo
4e5b8c9c34 Let sender = chat for messages from channels 2018-09-06 10:33:56 +02:00
Lonami Exo
ae085f30a8 Save update state upon disconnect 2018-09-04 11:58:55 +02:00
Lonami Exo
3c92f6a791 Fix sqlite's conn may be None if never used
This happened when signing up with the library
and getting migrate errors.
2018-09-04 11:28:01 +02:00
Lonami Exo
bbeb8f4ba3 Clarify and fix some docstrings 2018-09-04 11:27:10 +02:00
Wirtos
36df6d1bf9 Manually register ogg mimetype too (#973) 2018-08-28 21:17:10 +02:00
Lonami Exo
0e91fc3668 Manually register webp mimetype
Otherwise, sending stickers would fail on some systems.
2018-08-27 17:19:10 +02:00
Lonami Exo
8a9650f131 Fix-up previous commit 0bb0d0b missing parameter 2018-08-27 10:58:06 +02:00
Lonami Exo
576ac666d9 Fix resolving events while disconnected 2018-08-27 01:20:01 +02:00
Lonami Exo
5ca1edb228 Return the correct entity from .get_entity(username)
The precedence of the or operator made the check succeed always
out of pure luck, since `''.lower()` would never be the chosen
username, but a present username is truthy.

This presumably worked because Telegram only returns one result
from the call, or puts the right entity the first one.
2018-08-26 12:00:17 +02:00
s3mple
29d122e810 Fix-up previous commit f17d7e9 (#967) 2018-08-24 19:50:55 +02:00
s3mple
f17d7e9c5e New exception class for multiple errors (#965) 2018-08-24 18:25:58 +02:00
Lonami Exo
52a4327769 Fix MemorySession file caching 2018-08-22 16:21:22 +02:00
Lonami Exo
8e62f797bb Support custom encoding for StringSession 2018-08-22 16:12:27 +02:00
s3mple
aa9bc9080f Support custom symbol set for aggressive get_participants 2018-08-21 17:15:35 +02:00
Lonami Exo
fbc46bd388 Use loop.create_future instead asyncio.Future 2018-08-21 12:22:06 +02:00
Lonami Exo
d3a6822fc9 Properly resolve events 2018-08-21 12:18:12 +02:00
Lonami Exo
47190d7d55 Fix event loop not being passed into many asyncio calls 2018-08-21 11:31:14 +02:00
Lonami Exo
d474458136 Simplify event resolving logic
Although this commit introduces a race condition since an
event may only be half-resolved. A lock is thus needed,
but it depends on an event-loop to which we don't have
access in the class-level.
2018-08-21 11:08:08 +02:00
Lonami Exo
9f237cc928 Simplify event building logic
This will also fix some bugs where the event type being accessed
would not be available, since it is now built on-demand, without
the need to keep track for the count of each event type.
2018-08-21 10:27:12 +02:00
Lonami Exo
f0cd1fdd6e Don't disconnect sender on cancellation (#958)
This was causing a "race condition" where the sender would
be disconnected after cancellation when another was created.
2018-08-20 14:59:17 +02:00
Lonami Exo
171e13daa9 Special case File responses without parent request (#658) 2018-08-20 11:42:51 +02:00