Always treat UpdateShortChatMessage as minigroup messages

This commit is contained in:
Tulir Asokan
2022-11-18 17:11:45 +02:00
parent 6b55d5bb41
commit 7c8cf3cb50
+1 -3
View File
@@ -529,9 +529,7 @@ class AbstractUser(ABC):
self, update: UpdateMessage self, update: UpdateMessage
) -> tuple[UpdateMessageContent, pu.Puppet | None, po.Portal | None]: ) -> tuple[UpdateMessageContent, pu.Puppet | None, po.Portal | None]:
if isinstance(update, UpdateShortChatMessage): if isinstance(update, UpdateShortChatMessage):
portal = await po.Portal.get_by_tgid(TelegramID(update.chat_id)) portal = await po.Portal.get_by_tgid(TelegramID(update.chat_id), peer_type="chat")
if not portal:
self.log.warning(f"Received message in chat with unknown type {update.chat_id}")
sender = await pu.Puppet.get_by_tgid(TelegramID(update.from_id)) sender = await pu.Puppet.get_by_tgid(TelegramID(update.from_id))
elif isinstance(update, UpdateShortMessage): elif isinstance(update, UpdateShortMessage):
portal = await po.Portal.get_by_tgid( portal = await po.Portal.get_by_tgid(