From 8429f9bd3c4f20f8ae0ee8d09e06465f14c29597 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 27 Feb 2019 21:04:18 +0100 Subject: [PATCH] Update to v1.6 --- readthedocs/extra/changelog.rst | 94 +++++++++++++++++++++++ telethon/network/connection/tcpmtproxy.py | 6 +- telethon/version.py | 2 +- 3 files changed, 100 insertions(+), 2 deletions(-) diff --git a/readthedocs/extra/changelog.rst b/readthedocs/extra/changelog.rst index 5888fcbd..0ea2f47b 100644 --- a/readthedocs/extra/changelog.rst +++ b/readthedocs/extra/changelog.rst @@ -14,6 +14,100 @@ it can take advantage of new goodies! .. contents:: List of All Versions +Tidying up Internals (v1.6) +=========================== + +*Published at 2019/02/27* + ++-----------------------+ +| Scheme layer used: 95 | ++-----------------------+ + +First things first, sorry for updating the layer in the previous patch +version. That should only be done between major versions ideally, but +due to how Telegram works, it's done between minor versions. However raw +API has and will always be considered "unsafe", this meaning that you +should always really on the convenience client methods instead. You can't +do everything that you can do with raw API, so pull requests are welcome. + +Breaking Changes +~~~~~~~~~~~~~~~~ + +* The layer update, of course. This didn't really need a mention here. +* You can no longer pass a ``batch_size`` when iterating over messages. + No other method exposed this parameter, and it was only meant for testing + purposes. Instead, it's now a private constant. +* ``client.iter_*`` methods no longer have a ``_total`` parameter which + was supposed to be private anyway. Instead, they return a new generator + object which has a ``.total`` attribute: + + .. code-block:: python + + it = client.iter_messages(chat) + for i, message in enumerate(it, start=1): + percentage = i / it.total + print('{:.2%} {}'.format(percentage, message.text)) + +Additions +~~~~~~~~~ + +* You can now pass ``phone`` and ``phone_code_hash`` in `client.sign_up + `, although you probably don't + need that. +* Thanks to the overhaul of all ``client.iter_*`` methods, you can now do: + + .. code-block:: python + + for message in reversed(client.iter_messages('me')): + print(message.text) + +Bug fixes +~~~~~~~~~ + +* Fix `telethon.utils.resolve_bot_file_id`, which wasn't working after + the layer update (so you couldn't send some files by bot file IDs). +* Fix sending albums as bot file IDs (due to image detection improvements). +* Fix `takeout() ` failing + when they need to download media from other DCs. +* Fix repeatedly calling `conversation.get_response() + ` when many + messages arrived at once (i.e. when several of them were forwarded). +* Fixed connecting with `ConnectionTcpObfuscated + `. +* Fix `client.get_peer_id('me') + `. +* Fix warning of "missing sqlite3" when in reality it just had wrong tables. +* Fix a strange error when using too many IDs in `client.delete_messages() + `. +* Fix `client.send_file ` + with the result of `client.upload_file + `. +* When answering inline results, their order was not being preserved. +* Fix `events.ChatAction ` + detecting user leaves as if they were kicked. + +Enhancements +~~~~~~~~~~~~ + +* Cleared up some parts of the documentation. +* Improved some auto-casts to make life easier. +* Improved image detection. Now you can easily send ``bytes`` + and streams of images as photos, unless you force document. +* Sending images as photos that are too large will now be resized + before uploading, reducing the time it takes to upload them and + also avoiding errors when the image was too large (as long as + ``pillow`` is installed). The images will remain unchanged if you + send it as a document. +* Treat ``errors.RpcMcgetFailError`` as a temporary server error + to automatically retry shortly. This works around most issues. + +Internal changes +~~~~~~~~~~~~~~~~ + +* New common way to deal with retries (``retry_range``). +* Cleaned up the takeout client. +* Completely overhauled asynchronous generators. + Layer Update (v1.5.5) ===================== diff --git a/telethon/network/connection/tcpmtproxy.py b/telethon/network/connection/tcpmtproxy.py index 570d4267..92397da6 100644 --- a/telethon/network/connection/tcpmtproxy.py +++ b/telethon/network/connection/tcpmtproxy.py @@ -1,7 +1,6 @@ import hashlib from .tcpobfuscated import ConnectionTcpObfuscated -from ...crypto import AESModeCTR class ConnectionTcpMTProxy(ConnectionTcpObfuscated): @@ -10,6 +9,11 @@ class ConnectionTcpMTProxy(ConnectionTcpObfuscated): user to connect to the Telegram proxy servers commonly known as MTProxy. Implemented very ugly due to the leaky abstractions in Telethon networking classes that should be refactored later (TODO). + + .. warning:: + + The support for MTProtoProxies class is **EXPERIMENTAL** and prone to + be changed. You shouldn't be using this class yet. """ @staticmethod def address_info(proxy_info): diff --git a/telethon/version.py b/telethon/version.py index f02f6096..6cac16c9 100644 --- a/telethon/version.py +++ b/telethon/version.py @@ -1,3 +1,3 @@ # Versions should comply with PEP440. # This line is parsed in setup.py: -__version__ = '1.5.5' +__version__ = '1.6'