Skip to content

Commit

Permalink
Allow unbridging direct chat portals. Fixes #495
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 29, 2020
1 parent f088599 commit dd3bdd2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mautrix_telegram/commands/portal/unbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ async def _get_portal_and_check_permission(evt: CommandEvent) -> Optional[po.Por
await evt.reply(f"{that_this} is not a portal room.")
return None

if portal.peer_type == "user":
if portal.tg_receiver != evt.sender.tgid:
await evt.reply("You do not have the permissions to unbridge that portal.")
return None
return portal

if not await user_has_power_level(portal.mxid, evt.az.intent, evt.sender, "unbridge"):
await evt.reply("You do not have the permissions to unbridge that portal.")
return None
Expand Down

0 comments on commit dd3bdd2

Please sign in to comment.