mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-23 19:34:24 +03:00
Fix return value when fwding msgs if some are missing
It was supposed to return None for the spots were it failed to fwd a message, but instead only those that were present were returned, because we were iterating over the wrong object (dict and not list).
This commit is contained in:
parent
165950169f
commit
88e7f0da65
|
@ -211,13 +211,18 @@ class MessageParseMethods:
|
||||||
# deleted or `WORKER_BUSY_TOO_LONG_RETRY` if there are issues at
|
# deleted or `WORKER_BUSY_TOO_LONG_RETRY` if there are issues at
|
||||||
# Telegram), in which case we get some "missing" message mappings.
|
# Telegram), in which case we get some "missing" message mappings.
|
||||||
# Log them with the hope that we can better work around them.
|
# Log them with the hope that we can better work around them.
|
||||||
|
#
|
||||||
|
# This also happens when trying to forward messages that can't
|
||||||
|
# be forwarded because they don't exist (0, service, deleted)
|
||||||
|
# among others which could be (like deleted or existing).
|
||||||
self._log[__name__].warning(
|
self._log[__name__].warning(
|
||||||
'Request %s had missing message mappings %s', request, result)
|
'Request %s had missing message mappings %s', request, result)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
mapping.get(random_to_id.get(rnd))
|
(mapping.get(random_to_id[rnd]) or opposite.get(random_to_id[rnd]))
|
||||||
or opposite.get(random_to_id.get(rnd))
|
if rnd in random_to_id
|
||||||
for rnd in random_to_id
|
else None
|
||||||
|
for rnd in random_id
|
||||||
]
|
]
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
Loading…
Reference in New Issue
Block a user