Process entities from the MtProtoSender instead TelegramBareClient

This way, update objects will also be processed when they occur.
This commit is contained in:
Lonami Exo
2017-10-01 16:02:29 +02:00
parent 71b6e527a6
commit 36dabc4928
3 changed files with 26 additions and 25 deletions

View File

@@ -213,14 +213,8 @@ class MtProtoSender:
# If the code is not parsed manually then it should be a TLObject.
if code in tlobjects:
result = reader.tgread_object()
if state is None:
self._logger.debug(
'Ignoring unhandled TLObject %s', repr(result)
)
else:
self._logger.debug(
'Processing TLObject %s', repr(result)
)
self.session.process_entities(result)
if state:
state.process(result)
return True
@@ -364,6 +358,7 @@ class MtProtoSender:
reader.seek(-4)
request.on_response(reader)
self.session.process_entities(request.result)
request.confirm_received.set()
return True
else: