Ignore telegram updates in blacklisted chats
This commit is contained in:
@@ -404,6 +404,9 @@ class AbstractUser(ABC):
|
||||
|
||||
async def update_message(self, original_update: UpdateMessage) -> None:
|
||||
update, sender, portal = self.get_message_details(original_update)
|
||||
if portal and not portal.allow_bridging:
|
||||
self.log.debug(f"Ignoring message in portal {portal.tgid_log} (bridging disallowed)")
|
||||
return
|
||||
|
||||
if self.is_bot:
|
||||
if update.is_private:
|
||||
@@ -430,10 +433,8 @@ class AbstractUser(ABC):
|
||||
sender.id)
|
||||
return await portal.handle_telegram_action(self, sender, update)
|
||||
|
||||
user = sender.tgid if sender else "admin"
|
||||
if isinstance(original_update, (UpdateEditMessage, UpdateEditChannelMessage)):
|
||||
return await portal.handle_telegram_edit(self, sender, update)
|
||||
|
||||
return await portal.handle_telegram_message(self, sender, update)
|
||||
|
||||
# endregion
|
||||
|
||||
@@ -446,12 +446,13 @@ class BasePortal(ABC):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _update_title(self, title: str, save: bool = False) -> bool:
|
||||
async def _update_title(self, title: str, sender: Optional['p.Puppet'] = None,
|
||||
save: bool = False) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def _update_avatar(self, user: 'AbstractUser', photo: Union[TypeChatPhoto],
|
||||
save: bool = False) -> bool:
|
||||
sender: Optional['p.Puppet'] = None, save: bool = False) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
|
||||
Reference in New Issue
Block a user