Compare commits

...
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
__version__ = "0.7.1" __version__ = "0.7.2rc1"
__author__ = "Tulir Asokan <tulir@maunium.net>" __author__ = "Tulir Asokan <tulir@maunium.net>"
+2 -1
View File
@@ -421,7 +421,8 @@ class AbstractUser(ABC):
f" in unbridged chat {portal.tgid_log}") f" in unbridged chat {portal.tgid_log}")
return return
if self.ignore_incoming_bot_events and self.relaybot and sender.id == self.relaybot.tgid: if ((self.ignore_incoming_bot_events and self.relaybot
and sender and sender.id == self.relaybot.tgid)):
self.log.debug(f"Ignoring relaybot-sent message %s to %s", update.id, portal.tgid_log) self.log.debug(f"Ignoring relaybot-sent message %s to %s", update.id, portal.tgid_log)
return return
+5 -1
View File
@@ -25,7 +25,7 @@ from telethon.tl.types import (UserProfilePhoto, User, UpdateUserName, PeerUser,
from mautrix.appservice import AppService, IntentAPI from mautrix.appservice import AppService, IntentAPI
from mautrix.errors import MatrixRequestError from mautrix.errors import MatrixRequestError
from mautrix.bridge import CustomPuppetMixin from mautrix.bridge import CustomPuppetMixin
from mautrix.types import UserID, SyncToken from mautrix.types import UserID, SyncToken, RoomID
from mautrix.util.simple_template import SimpleTemplate from mautrix.util.simple_template import SimpleTemplate
from .types import TelegramID from .types import TelegramID
@@ -320,6 +320,10 @@ class Puppet(CustomPuppetMixin):
return True return True
return False return False
def default_puppet_should_leave_room(self, room_id: RoomID) -> bool:
portal: p.Portal = p.Portal.get_by_mxid(room_id)
return portal and not portal.backfilling and portal.peer_type != "user"
# endregion # endregion
# region Getters # region Getters