Commit Graph

428 Commits

Author SHA1 Message Date
Lonami Exo
d12fb5b924 Add an optional reply_to parameter to .send_message/media 2017-09-13 11:51:23 +02:00
Lonami Exo
7043f4c9ba Add a convenience method to send voice notes 2017-09-13 11:30:20 +02:00
Lonami Exo
d79dccc923 Add a lock around TcpClient.close() to try avoiding None.close() 2017-09-13 09:44:58 +02:00
Lonami Exo
1d36bbfbf4 Remove forgotten invalid code CdnDecrypter.finish_check (fix #243) 2017-09-12 15:38:00 +02:00
Lonami Exo
3a5eab2e83 Fix infering random_id lists failing for ForwardMessages 2017-09-12 10:32:11 +02:00
Lonami Exo
a76c31ede2 Add lru_cache decorator to .get_entity() 2017-09-11 12:53:39 +02:00
Lonami Exo
83f9cafabf Make .get_entity() public 2017-09-11 11:54:32 +02:00
Lonami Exo
188b1c8816 Fix client reconnection not actually working 2017-09-11 11:38:36 +02:00
Lonami Exo
a2fdd4b196 Ignore InvalidChecksumError's 2017-09-11 11:04:19 +02:00
Lonami Exo
48dead76ac Retry up to five times before giving up on a request 2017-09-11 10:52:36 +02:00
Lonami Exo
880f5636be Move README-long.rst to the wiki hosted on GitHub 2017-09-10 16:01:58 +02:00
Lonami Exo
8eabdad711 Remove confussion on issue template suggesting to remove last block 2017-09-09 10:41:41 +02:00
Lonami Exo
bce88446ef Fix incorrect condition causing updates to be ignored 2017-09-08 18:43:37 +02:00
Lonami Exo
54ba0661c6 Fix wrong variable name causing .connect() to fail 2017-09-08 18:28:31 +02:00
Lonami Exo
fa4042a80e Update to v0.13.2 2017-09-08 13:22:05 +02:00
Lonami
2dea665721 New way to work with updates (#237) 2017-09-08 13:11:04 +02:00
Lonami Exo
c81537bed0 Simplify the workflow with UpdateState exposing a single flag param 2017-09-08 12:54:38 +02:00
Lonami Exo
25bbb20b0c Use RLocks properly on MtProtoSender (only needed on net IO) 2017-09-07 21:32:46 +02:00
Lonami Exo
16a5ab3070 Add back the periodic PingRequest 2017-09-07 21:23:37 +02:00
Lonami Exo
a24b4020fe Allow adding update handlers without the need to poll updates 2017-09-07 20:29:51 +02:00
Lonami Exo
b8e881b6b6 Add basic updates processing to ignore updates with lower .pts 2017-09-07 20:17:40 +02:00
Lonami Exo
d237375208 Allow adding callback methods to UpdateState 2017-09-07 18:58:54 +02:00
Lonami Exo
d4f36162cd Create and use UpdateState to .process() unhandled TLObjects 2017-09-07 18:49:08 +02:00
Lonami Exo
49e884b005 Raise AssertionError if trying to invoke requests from ReadThread 2017-09-07 18:48:41 +02:00
Lonami Exo
06b2834c02 Fix GetContactsRequest using str instead int (layer 70->71) (#234) 2017-09-07 10:45:55 +02:00
Birger Jarl
edf325d580 Fix username regex (#235)
Username max length is 1+31 = 32
2017-09-07 09:41:49 +02:00
Lonami Exo
a93abed737 Add ISSUE_TEMPLATE for GitHub 2017-09-05 19:16:22 +02:00
xkdnyan
cd40f4a949 Add RPCError for MESSAGE_NOT_MODIFIED (#231) 2017-09-05 17:06:35 +02:00
Lonami Exo
49555ad018 Stick to the offset and limit CdnFileHashes dictates (#222)
The old intersection method and allowing an arbitrary part size
wasn't working properly. Assuming that Telegram will send a sha
sum for the whole file, in the correct order, we can simply use
their offsets to download the file.
2017-09-05 16:43:53 +02:00
Lonami Exo
2924912931 Fix CDN downloads not always calling GetCdnConfigRequest (#222)
On previous tests, Telegram didn't return information about CDNs
on the initial GetConfigRequest. However, it may do so, and it's
necessary to call GetCdnConfigRequest even when a second call to
GetConfigRequest isn't required.
2017-09-05 16:11:02 +02:00
Lonami Exo
d5cd59de8a Update to v0.13.1 2017-09-04 20:34:05 +02:00
Lonami Exo
a38381665c Support invoking requests from within the ReadThread (fixes #226) 2017-09-04 20:28:41 +02:00
Lonami Exo
fe86b88bef Make .sign_up() return the logged user just like .sign_in() 2017-09-04 18:07:20 +02:00
Lonami Exo
15fd5390ae Optimize imports 2017-09-04 17:18:33 +02:00
Lonami Exo
97cab7347b Make lint happier 2017-09-04 17:10:04 +02:00
Lonami Exo
7f700c3bc1 Remove unused attributes and methods from the base TLObject class 2017-09-04 16:39:16 +02:00
Lonami Exo
0e45f46ad5 Properly ignore core types when generating code 2017-09-04 16:38:03 +02:00
Lonami Exo
e8cdcf369d Sort generated code by name for more predictable results 2017-09-04 15:11:46 +02:00
Lonami Exo
c5b562d4f6 Move the from tlobject import TLObject to only the top of the file 2017-09-04 14:08:36 +02:00
Lonami Exo
64f1031a45 Move comments from auto-generated code to the generator itself 2017-09-04 14:05:30 +02:00
Lonami Exo
c3f679597c Move the auto-generated notice to only the top of the file 2017-09-04 13:57:40 +02:00
Lonami Exo
e83b250a22 Replace generated directory modules with simply files 2017-09-04 13:51:47 +02:00
Lonami Exo
7eab28206b Change the code generator to use a single file per namespace 2017-09-04 13:44:39 +02:00
Lonami Exo
dc238df2e0 Update to v0.13 2017-09-04 12:18:45 +02:00
Lonami Exo
a5d86b4572 Update to layer 71 2017-09-04 11:54:37 +02:00
Lonami Exo
6f0bd14c2f Use an Enum for the ConnectionMode and support specifying it 2017-09-04 11:24:10 +02:00
Lonami Exo
62a52679f4 Ensure the state of the requests is clean before invoking them 2017-09-03 13:45:13 +02:00
Lonami Exo
27408b46da Only reconnect from background thread if .disconnect wasn't called 2017-09-03 13:44:52 +02:00
Lonami Exo
626778bd32 Ignore EBADF when closing the socket 2017-09-03 13:44:29 +02:00
Lonami Exo
68cdc9eaf1 Treat OSError.errno == EBADF as a ConnectionResetError 2017-09-03 11:54:26 +02:00