diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-09-09 13:56:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 13:56:33 +0200 |
commit | 64472d9aab85bf56fb345570459c372b78a14b8c (patch) | |
tree | 16ea52999b31aed90ed883a47031c0cff6141d3f /userapi/userapi.go | |
parent | 42a82091a8932fd92e36ba41c644c2058ab7dce6 (diff) |
Update getting pushrules, add tests, tweak pushrules (#2705)
This PR
- adds tests for `evaluatePushrules`
- removes the need for the UserAPI on the `OutputStreamEventConsumer`
(for easier testing)
- adds a method to get the pushrules from the database
- adds a new default pushrule for `m.reaction` events (and some other
tweaks)
Diffstat (limited to 'userapi/userapi.go')
-rw-r--r-- | userapi/userapi.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/userapi/userapi.go b/userapi/userapi.go index 2e86d6aa..23855a89 100644 --- a/userapi/userapi.go +++ b/userapi/userapi.go @@ -18,6 +18,8 @@ import ( "time" "github.com/gorilla/mux" + "github.com/sirupsen/logrus" + "github.com/matrix-org/dendrite/internal/pushgateway" keyapi "github.com/matrix-org/dendrite/keyserver/api" rsapi "github.com/matrix-org/dendrite/roomserver/api" @@ -31,7 +33,6 @@ import ( "github.com/matrix-org/dendrite/userapi/producers" "github.com/matrix-org/dendrite/userapi/storage" "github.com/matrix-org/dendrite/userapi/util" - "github.com/sirupsen/logrus" ) // AddInternalRoutes registers HTTP handlers for the internal API. Invokes functions @@ -90,7 +91,7 @@ func NewInternalAPI( } eventConsumer := consumers.NewOutputStreamEventConsumer( - base.ProcessContext, cfg, js, db, pgClient, userAPI, rsAPI, syncProducer, + base.ProcessContext, cfg, js, db, pgClient, rsAPI, syncProducer, ) if err := eventConsumer.Start(); err != nil { logrus.WithError(err).Panic("failed to start user API streamed event consumer") |