Improve things

This commit is contained in:
Tulir Asokan
2019-08-06 21:30:14 +03:00
parent 45f1dddb81
commit 8655f5903a
9 changed files with 72 additions and 41 deletions
+6 -1
View File
@@ -28,7 +28,7 @@ from mautrix.types import UserID
from .types import TelegramID
from .db import Puppet as DBPuppet
from . import util
from . import util, portal as p
if TYPE_CHECKING:
from .matrix import MatrixHandler
@@ -135,6 +135,11 @@ class Puppet(CustomPuppetMixin):
) -> Awaitable[Union[TypeInputPeer, TypeInputUser]]:
return user.client.get_input_entity(self.peer)
def intent_for(self, portal: 'p.Portal') -> IntentAPI:
if portal.tgid == self.tgid:
return self.default_mxid_intent
return self.intent
# region DB conversion
@property