Only leave group chat portals with default puppet. Fixes #418
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user