-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement separate bot users per service (#573)
* Add service bots config * Add joined rooms manager and keep track of joined rooms * Add bot users manager and ensure registration and profiles * Improve joined rooms manager and set up already joined rooms * Handle invites with service bots * Handle messages with service bots * Use service bots for connections * Use service bots in widget and provisioning APIs * Use service bots in setup connections * Use service bots for feed connections * Handle admin rooms for service bots * Fix confused event type and service type in provisioning and widget APIs * Fix generic webhooks service name * Fix enabled services config * Handle power level change * Create widgets with service scope * Use service bots for gitlab repo connections * Use service bots for gitlab issue connections * Use service bots for generic webhook connections * Use service bots for figma file connections * Use service bots when verifying state events * Use service bots for github repo connections * Use service bots for github discussion connections * Use service bots for github discussion space connections * Use service bots for github project connections * Use service bots for github issue connections * Use service bots for github user space connections * Use service bots for jira connections * Make sure ghost users are invited for gitlab issue comments * Configure one service per service bot * Add changelog * Update tests * Fix up following rebase * Fix comment * Use getter for enabled services * Ensure homeserver can be reached before registering bots * Add intent getter on bot user * Update config comment * Merge joined rooms manager with bot users manager * Remove unused localpart from bot user class * Refactor to pass in bot users manager * Improve priority sort function Co-authored-by: Christian Paul <[email protected]> * Fix priority sort Higher priority should come first * Add debug log when invites are rejected * Use different state key for scoped setup widgets * Use different subtitles to differentiate service bots setup widgets * Refactor bot user setup into bot users manager * Refactor to reduce duplication in widget API * Consistent room ID and intent args order * Add docs and update changelog * Add overrideUserId deprecation warning * Add service bots link Co-authored-by: Christian Paul <[email protected]> Co-authored-by: Will Hunt <[email protected]>
- Loading branch information
1 parent
46467ac
commit 9a7839c
Showing
34 changed files
with
1,133 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for additional bot users called "service bots" which handle a particular connection type, so that different services can be used through different bot users. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Service Bots | ||
|
||
Hookshot supports additional bot users called "service bots" which handle a particular connection type | ||
(in addition to the default bot user which can handle any connection type). | ||
These bots can coexist in a room, each handling a different service. | ||
|
||
## Configuration | ||
|
||
Service bots can be given a different localpart, display name, avatar, and command prefix. | ||
They will only handle connections for the specified service, which can be one of: | ||
* `feeds` - [Feeds](../setup/feeds.md) | ||
* `figma` - [Figma](../setup/figma.md) | ||
* `generic` - [Webhooks](../setup/webhooks.md) | ||
* `github` - [GitHub](../setup/github.md) | ||
* `gitlab` - [GitLab](../setup/gitlab.md) | ||
* `jira` - [Jira](../setup/jira.md) | ||
|
||
For example with this configuration: | ||
```yaml | ||
serviceBots: | ||
- localpart: feeds | ||
displayname: Feeds | ||
avatar: mxc://half-shot.uk/2876e89ccade4cb615e210c458e2a7a6883fe17d | ||
prefix: "!feeds" | ||
service: feeds | ||
``` | ||
There will be a bot user `@feeds:example.com` which responds to commands prefixed with `!feeds`, and only handles feeds connections. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.