Commit Graph

2981 Commits

Author SHA1 Message Date
Lonami Exo
32786d16fd Support using the client in with blocks 2018-06-26 11:26:01 +02:00
Lonami Exo
d4b508bf48 Fix __del__ with sync magic 2018-06-26 11:23:51 +02:00
Lonami Exo
75dc4809f5 Remove all deprecated methods 2018-06-26 11:10:11 +02:00
Lonami Exo
a43c6c2b68 Work around Python 3.5.2 bug causing 100% CPU load on script's end 2018-06-26 11:10:11 +02:00
Lonami Exo
f295ea668a Make sync.syncify a public function for user types 2018-06-26 11:10:11 +02:00
Lonami Exo
044e6e8a85 Await updates task to finish upon disconnect 2018-06-26 11:10:11 +02:00
Hasan
6ab8571168 Use better practices for logo's svg 2018-06-26 10:12:00 +02:00
Lonami Exo
184240953d Make more emphasis in the magic sync module 2018-06-25 21:34:48 +02:00
Lonami Exo
fc834f60fb Fix custom.Dialog passing the wrong instance to custom.Draft 2018-06-25 21:24:46 +02:00
Lonami Exo
d65f8ecc0d Document the magic sync module 2018-06-25 21:14:58 +02:00
Lonami Exo
551b0044ce Reuse more code using sqlite's cursor 2018-06-25 20:11:48 +02:00
Lonami Exo
313bead615 Close sqlite's cursor after usage 2018-06-25 19:49:33 +02:00
Lonami Exo
4da50ba3a0 Add a syncify magic module to use asyncio as sync 2018-06-25 14:24:56 +02:00
Lonami Exo
9c6d2894fc Allow start when the loop is not running 2018-06-25 13:42:29 +02:00
Lonami Exo
db5cb74bdd Allow run_until_disconnected when the loop is running 2018-06-25 13:32:31 +02:00
Lonami Exo
c1046c2acc Fix "user joined" being "user added itself" 2018-06-25 13:21:23 +02:00
Lonami Exo
59f6b75391 Stop showing "data left after" warning 2018-06-25 12:54:33 +02:00
Lonami Exo
410518aa65 Stop using await with properties 2018-06-25 11:38:56 +02:00
Lonami Exo
0d09f9d8c1 Create a custom.Forward class 2018-06-25 11:34:10 +02:00
Lonami Exo
efc9f4c414 Get rid of all remaining async properties 2018-06-25 11:03:20 +02:00
Lonami Exo
ae47fd37b0 Update to v1.0-rc1 2018-06-24 15:51:24 +02:00
Lonami Exo
266d44dd86 Fix EventsCommon still having async properties 2018-06-24 13:05:58 +02:00
Lonami Exo
d4479a0a4e Save the session file less often 2018-06-24 12:21:58 +02:00
Lonami Exo
026c0c4f9d Update examples to be async 2018-06-24 12:04:23 +02:00
Lonami Exo
58031b3adf Update to layer 81 2018-06-24 11:37:54 +02:00
Lonami Exo
184424957d Create a separate method to start reconnections 2018-06-24 10:44:31 +02:00
Lonami Exo
0d0e78e10b Use the right chat peer in private messages 2018-06-23 15:10:07 +02:00
Lonami Exo
51da48ddd2 Support custom parse_mode to use MessageEntityMentionName 2018-06-22 16:18:23 +02:00
Lonami Exo
f614d3836b Finish up asyncio docs 2018-06-22 14:44:59 +02:00
Lonami Exo
3d3698562b Cleanly handle KeyboardInterrupt in run_until_disconnected 2018-06-22 13:26:24 +02:00
Lonami Exo
1a1d9d346c Fix most private messages being outgoing since 56ddaae
56ddaae checked to_id and from_id to compare if they were equal,
and if they were, mark the event as outgoing for convenience in
your private chat (saved messages).

However when reconstructing the Message from UpdateShortMessage
to_id didn't mimic 100% Telegram's behaviour (the chat to which
the message is sent is "different" depending on who sent the
messages). This bug is what actually caused most messages to
be outgoing, even though 56ddaae's logic is correct.
2018-06-22 10:25:20 +02:00
Lonami Exo
8d98c04932 Fix awaits on input_chat property 2018-06-22 10:05:29 +02:00
Lonami Exo
f733f8e565 Rewrite the first part of the docs for asyncio 2018-06-21 21:54:54 +02:00
Lonami Exo
5e322a6ca9 Remove async properties from custom.Message
Awaiting on a property was strange and only really made sense
in events.NewMessage. Methods like client.get_messages() and
similar return entire custom.Message which won't need to touch
the network, and requiring the await was a poor UX.
2018-06-21 21:15:48 +02:00
Lonami Exo
3973755333 Support .name attr in utils.is_type/client.upload_file
This means open()'ed files will have their name used properly,
and that you can set b.name = 'somename.jpg' to io.BytesIO()
objects to have them uploaded as images.
2018-06-21 16:31:03 +02:00
Lonami Exo
d8af64e3b9 Clarify/fix get[_input]_entity docstrings 2018-06-21 11:08:14 +02:00
Lonami Exo
777c91ee14 Fix setup.py 2018-06-21 10:48:47 +02:00
Lonami Exo
5c602d4ba7 Add __str__ to RpcResult/GzipPacked 2018-06-21 09:58:12 +02:00
Lonami Exo
a99fce471a Fix cancelling a None handle on first connection+error 2018-06-21 09:48:11 +02:00
Lonami Exo
cfa5cd0db2 Fix is_user_authorized always returning True 2018-06-21 09:32:09 +02:00
Lonami Exo
8d5c052fce Fix TypeError when accessing unexisting sender 2018-06-21 09:26:31 +02:00
Lonami Exo
d6818f25f5 Fix rare iter_dialogs infinite loop 2018-06-20 21:12:47 +02:00
Lonami Exo
9c0a22ddd7 Fix Python 3.5 compatibility 2018-06-20 20:18:16 +02:00
Lonami Exo
9e3f6483e8 Fix pattern= and move pattern_match to events.NewMessage 2018-06-20 20:03:44 +02:00
Lonami Exo
a1477a84bf Update in-memory updates.State 2018-06-20 19:58:01 +02:00
Lonami Exo
4ab5c7d92d Fix reconnect sentinel when not reconnecting in send_loop
It would cause issues with the debug logs, since it assumes it's
a TLMessage, which have an .obj attribute. Second, the send_loop
is also smarter regarding reconnects (since OSError often occur
due to not being connected at all, namely ConnectionResetError).
2018-06-20 18:19:57 +02:00
Lonami Exo
c8ee0bdca9 Fix socket may be None when closing twice 2018-06-20 17:59:11 +02:00
Lonami Exo
a0eb824e87 Support ignore_migrated in iter_dialogs 2018-06-20 12:03:42 +02:00
Lonami Exo
c893eaaa84 Allow filtering new messages by sender/forwards 2018-06-20 11:58:44 +02:00
Lonami Exo
ad1ab64415 Save last ack to resend in case of bad salt 2018-06-20 11:12:04 +02:00