Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set-pl command and fixed reply #29

Merged
merged 6 commits into from
Oct 8, 2020
Merged

set-pl command and fixed reply #29

merged 6 commits into from
Oct 8, 2020

Conversation

witchent
Copy link
Contributor

@witchent witchent commented Oct 7, 2020

One should probably move the main_intent of the bridge to the event at some point to remove the async of reply, but it is working like this.

mautrix/bridge/commands/admin.py Outdated Show resolved Hide resolved
mautrix/bridge/commands/admin.py Outdated Show resolved Hide resolved
Co-authored-by: Tulir Asokan <[email protected]>
Co-authored-by: Tulir Asokan <[email protected]>
Copy link
Contributor Author

@witchent witchent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not what I wanted to do I think. What do you think about turning mark_read into async and check for room_id (this is not tested)?

portal = await self.processor.bridge.get_portal(self.room_id)
return await portal.main_intent.send_notice(self.room_id, message, html=html)
else:
return await self.az.intent.send_notice(self.room_id, message, html=html)

def mark_read(self) -> Awaitable[None]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def mark_read(self) -> Awaitable[None]:
async def mark_read(self) -> Awaitable[None]:

Comment on lines +148 to +149
if not self.is_portal:
return self.az.intent.mark_read(self.room_id, self.event_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not self.is_portal:
return self.az.intent.mark_read(self.room_id, self.event_id)
if self.room_id in await self.az.intent.get_joined_rooms():
return self.az.intent.mark_read(self.room_id, self.event_id)

@tulir tulir changed the base branch from release-0.7 to master October 8, 2020 11:37
@tulir tulir merged commit 26fdc77 into mautrix:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants