Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b4cf8cd451 | |||
| 80ff9d0f66 | |||
| b0e60e60e4 | |||
| c4b9a76931 | |||
| fe52f0ad10 | |||
| a9abf9a1af |
@@ -1,2 +1,2 @@
|
||||
__version__ = "0.7.0rc4"
|
||||
__version__ = "0.7.1rc1"
|
||||
__author__ = "Tulir Asokan <tulir@maunium.net>"
|
||||
|
||||
@@ -108,9 +108,9 @@ class Bot(AbstractUser):
|
||||
if isinstance(chat, ChatForbidden) or chat.left or chat.deactivated:
|
||||
self.remove_chat(TelegramID(chat.id))
|
||||
|
||||
channel_ids = (InputChannel(chat_id, 0)
|
||||
channel_ids = [InputChannel(chat_id, 0)
|
||||
for chat_id, chat_type in self.chats.items()
|
||||
if chat_type == "channel")
|
||||
if chat_type == "channel"]
|
||||
for channel_id in channel_ids:
|
||||
try:
|
||||
await self.client(GetChannelsRequest([channel_id]))
|
||||
|
||||
@@ -222,7 +222,7 @@ class BasePortal(ABC):
|
||||
return False
|
||||
evt_type = EventType.find(f"net.maunium.telegram.{event}")
|
||||
evt_type.t_class = EventType.Class.STATE
|
||||
return self.main_intent.state_store.has_power_level(self.mxid, user.mxid, event=evt_type)
|
||||
return self.main_intent.state_store.has_power_level(self.mxid, user.mxid, evt_type)
|
||||
|
||||
def get_input_entity(self, user: 'AbstractUser'
|
||||
) -> Awaitable[Union[TypeInputPeer, TypeInputChannel]]:
|
||||
|
||||
@@ -42,7 +42,7 @@ setuptools.setup(
|
||||
|
||||
install_requires=[
|
||||
"aiohttp>=3.0.1,<4",
|
||||
"mautrix>=0.4.0rc5,<0.5",
|
||||
"mautrix>=0.4.0,<0.5",
|
||||
"SQLAlchemy>=1.2.3,<2",
|
||||
"alembic>=1.0.0,<2",
|
||||
"commonmark>=0.8.1,<0.10",
|
||||
|
||||
@@ -26,7 +26,7 @@ def context(request: FixtureRequest) -> Context:
|
||||
"""
|
||||
# Config(path, registration_path, base_path)
|
||||
config = getattr(request.cls, 'config', Config("", "", ""))
|
||||
return Context(az=Mock(), config=config, loop=Mock(), session_container=Mock(), bot=Mock())
|
||||
return Context(az=Mock(), config=config, loop=Mock(), session_container=Mock(), bridge=Mock(), bot=Mock())
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -52,6 +52,7 @@ class TestCommandEvent:
|
||||
sender=u.User(UserID("@sender:example.org")),
|
||||
command="help",
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=True,
|
||||
is_portal=False,
|
||||
)
|
||||
@@ -107,6 +108,7 @@ class TestCommandEvent:
|
||||
sender=u.User(UserID("@sender:example.org")),
|
||||
command="help",
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=False,
|
||||
is_portal=False,
|
||||
)
|
||||
@@ -133,6 +135,7 @@ class TestCommandEvent:
|
||||
sender=u.User(UserID("@sender:example.org")),
|
||||
command="help",
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=True,
|
||||
is_portal=False,
|
||||
)
|
||||
@@ -209,6 +212,7 @@ class TestCommandHandler:
|
||||
sender=sender,
|
||||
command=command,
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=False,
|
||||
is_portal=boolean,
|
||||
)
|
||||
@@ -271,6 +275,7 @@ class TestCommandHandler:
|
||||
sender=sender,
|
||||
command=command,
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=is_management,
|
||||
is_portal=boolean,
|
||||
)
|
||||
@@ -307,6 +312,7 @@ class TestCommandProcessor:
|
||||
sender=sender,
|
||||
command="hElp",
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=boolean2[0],
|
||||
is_portal=boolean2[1])
|
||||
|
||||
@@ -333,6 +339,7 @@ class TestCommandProcessor:
|
||||
sender=sender,
|
||||
command="foo",
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=boolean2[0],
|
||||
is_portal=boolean2[1],
|
||||
)
|
||||
@@ -361,6 +368,7 @@ class TestCommandProcessor:
|
||||
sender=sender, # u.User
|
||||
command="foo",
|
||||
args=[],
|
||||
content=Mock(),
|
||||
is_management=boolean2[0],
|
||||
is_portal=boolean2[1]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user