Minor improvement to updates handling

Now the updates thread won't start unless you add,
at least, one updates handler. Also, if the TcpClient
was receiving (i.e., from an update), it will let the
update to be received first instead of crashing
This commit is contained in:
Lonami
2016-09-11 11:50:38 +02:00
parent c11795f294
commit cdb1674a27
4 changed files with 31 additions and 34 deletions

View File

@@ -123,9 +123,8 @@ def parse_message_entities(msg):
# Second case, both inside: so*me_th*in_g.
# In this case, the current entity length is decreased by one,
# and all the subentities offset and length decrease 1
elif (subentity.offset > entity.offset and
subentity.offset < entity.offset + entity.length and
subentity.offset + subentity.length > entity.offset + entity.length):
elif (entity.offset < subentity.offset < entity.offset + entity.length and
subentity.offset + subentity.length > entity.offset + entity.length):
entity.length -= 1
subentity.offset -= 1
subentity.length -= 1