Skip to content

Commit cb26030

Browse files
committed
Make AppServiceServerMixin usable standalone
1 parent cef7b5a commit cb26030

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mautrix/appservice/as_handler.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,17 @@ class AppServiceServerMixin:
4848
otk_handler: Callable[[dict[UserID, dict[DeviceID, DeviceOTKCount]]], Awaitable] | None
4949
device_list_handler: Callable[[DeviceLists], Awaitable] | None
5050

51-
def __init__(self, ephemeral_events: bool = False, encryption_events: bool = False) -> None:
51+
def __init__(
52+
self,
53+
ephemeral_events: bool = False,
54+
encryption_events: bool = False,
55+
log: logging.Logger | None = None,
56+
hs_token: str | None = None,
57+
) -> None:
58+
if log is not None:
59+
self.log = log
60+
if hs_token is not None:
61+
self.hs_token = hs_token
5262
self.transactions = set()
5363
self.event_handlers = []
5464
self.to_device_handler = None

0 commit comments

Comments
 (0)