diff options
author | S7evinK <2353100+S7evinK@users.noreply.github.com> | 2022-02-18 16:05:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 16:05:03 +0100 |
commit | 002429c9e24cc746e0929b41eccbe429f89a6e1f (patch) | |
tree | 217eaea280343f46c61868a694d75fccd8fe66af /roomserver/internal/api.go | |
parent | dbded875257703eb63c8eb8af8d47d74c811642f (diff) |
Implement server notices (#2180)
* Add server_notices config
* Disallow rejecting "server notice" invites
* Update config
* Slightly refactor sendEvent and CreateRoom so it can be reused
* Implement unspecced server notices
* Validate the request
* Set the user api when starting
* Rename function/variables
* Update comments
* Update config
* Set the avatar on account creation
* Update test
* Only create the account when starting
Only add routes if sever notices are enabled
* Use reserver username
Check that we actually got roomData
* Add check for admin account
Enable server notices for CI
Return same values as Synapse
* Add custom error for rejecting server notice invite
* Move building an invite to it's own function, for reusability
* Don't create new rooms, use the existing one (follow Synapse behavior)
Co-authored-by: kegsay <kegan@matrix.org>
Diffstat (limited to 'roomserver/internal/api.go')
-rw-r--r-- | roomserver/internal/api.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/roomserver/internal/api.go b/roomserver/internal/api.go index e58f11c1..10c8c844 100644 --- a/roomserver/internal/api.go +++ b/roomserver/internal/api.go @@ -15,6 +15,7 @@ import ( "github.com/matrix-org/dendrite/roomserver/storage" "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/setup/process" + userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" @@ -159,6 +160,10 @@ func (r *RoomserverInternalAPI) SetFederationAPI(fsAPI fsAPI.FederationInternalA } } +func (r *RoomserverInternalAPI) SetUserAPI(userAPI userapi.UserInternalAPI) { + r.Leaver.UserAPI = userAPI +} + func (r *RoomserverInternalAPI) SetAppserviceAPI(asAPI asAPI.AppServiceQueryAPI) { r.asAPI = asAPI } |