-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Support plumbing WA groups #512
Conversation
"calling `$cmdprefix bridge` and this command.\n\n" + | ||
"Please start over by calling the bridge command again.", | ||
) | ||
return | ||
} else if ce.Args[0] != "continue" { | ||
ce.Reply("Please use `$cmdprefix continue` to confirm the bridging or " + | ||
"`$cmdprefix cancel` to cancel.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the double spaces intended?
Do string templates ask for a space after a variable name?
"calling `$cmdprefix bridge` and this command.\n\n" + | |
"Please start over by calling the bridge command again.", | |
) | |
return | |
} else if ce.Args[0] != "continue" { | |
ce.Reply("Please use `$cmdprefix continue` to confirm the bridging or " + | |
"`$cmdprefix cancel` to cancel.", | |
"calling `$cmdprefix bridge` and this command.\n\n" + | |
"Please start over by calling the bridge command again.", | |
) | |
return | |
} else if ce.Args[0] != "continue" { | |
ce.Reply("Please use `$cmdprefix continue` to confirm the bridging or " + | |
"`$cmdprefix cancel` to cancel.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because of a bug in mautrix-go
. Without the spaces, the message is printed as !wacancel
. I'll submit a fix there when I get a chance.
$cmdprefix+sp
isn't supported either, sadly.
Also check for state event PLs for unbridging/deleting portals
While creating a new WA group for a Matrix room, wait until it's finished before auto-creating new portal rooms for joined groups.
Also: - Check for permissions when plumbing with `create` - Add some more checks on command arguments - Make some help message formatting more consistent
- Match on it case-insensitively - Check against a const instead of a re-typed literal
Namely, avoid building the message string when it's unneeded
When setting a user/puppet's power level with the bridge bot, reduce the power level to a value below the bot's own level. Also don't try to change levels that are >= the bot's level, or when the bot doesn't have permissions to edit power levels.
Before preparing a portal in an existing Matrix room, check that the room's power levels allow bridging to work properly. If not, notify the user of which permissions are missing. Support this for both bot commands and the provisioning API.
- Allow specifying a target room - Make `delete-all` check for unbridge permissions - Fix the unbridge permission check to use the target room, not the current room - Make provisioning API check for unbridge permissions before swapping portal rooms
If unbridged invites are allowed, require admin permissions to delete a portal with unbridged members.
GetPortalByJID never returns nil
Mention that it can get the link of a specified room
This is a doozy, so I'll break down the changes:
Many of these features are based on what mautrix-telegram supports. This rebases fairly cleanly onto the tip of master (e59c4e2 at the time of writing), with only one easily-resolvable conflict. If it's preferred to rebase this PR now, I'll do it. I've already made a branch for it here. |
Can this be translated to other python based bridges such as https://github.com/mautrix/facebook (mautrix/facebook#80)? |
Yes, especially since much of this PR is based on Python code from mautrix-telegram. |
Is there some more work required to merge this ? |
@tulir any plan to release this sometime soon? |
If I can reactivate @Gredin67's question, would this be mergeable soon? |
Closed? |
Fixes #202
Plumbing is available via the
open
command by specifying which room to bridge a given WA group into, instead of creating a new room. The room can be specified by its ID, alias, or--here
(as a shortcut to refer to the current room).The code & UX for this is based mautrix-telegram's plumbing support, though that bridge exposes plumbing via a standalone
bridge
command.TODO:
unbridge
command (unlessdelete-portal
is good enough)join
andpm
commands