Fix random bugs and update mautrix-python
This commit is contained in:
@@ -455,8 +455,11 @@ class PortalTelegram(BasePortal, ABC):
|
||||
else self.tgid))
|
||||
min_id = last.tgid if last else 0
|
||||
if last_id is None:
|
||||
message = (await source.client.get_messages(self.peer, limit=1))[0]
|
||||
last_id = message.id
|
||||
messages = await source.client.get_messages(self.peer, limit=1)
|
||||
if not messages:
|
||||
# The chat seems empty
|
||||
return
|
||||
last_id = messages[0].id
|
||||
if last_id <= min_id:
|
||||
# Nothing to backfill
|
||||
return
|
||||
|
||||
@@ -262,7 +262,7 @@ class Puppet(BasePuppet):
|
||||
allow_because = "user is bot"
|
||||
elif self.displayname_source == source.tgid:
|
||||
allow_because = "user is the primary source"
|
||||
elif not info.contact:
|
||||
elif not isinstance(info, UpdateUserName) and not info.contact:
|
||||
allow_because = "user is not a contact"
|
||||
elif self.displayname_source is None:
|
||||
allow_because = "no primary source set"
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ python-magic>=0.4,<0.5
|
||||
commonmark>=0.8,<0.10
|
||||
aiohttp>=3,<3.7
|
||||
yarl<1.6
|
||||
mautrix==0.8.0.beta10
|
||||
mautrix==0.8.0rc1
|
||||
telethon>=1.17,<1.18
|
||||
telethon-session-sqlalchemy>=0.2.14,<0.3
|
||||
|
||||
Reference in New Issue
Block a user