aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/sendevent.go
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-19 15:50:33 +0100
committerGitHub <noreply@github.com>2023-04-19 15:50:33 +0100
commit72285b2659a31ebd52c91799c17105d81d996f40 (patch)
tree1855395f5efdc3ea6051dd502882bf62aaa57e7c /clientapi/routing/sendevent.go
parent9fa39263c0a4a8d349c8715f6ba30cae30b1b73a (diff)
refactor: update GMSL (#3058)
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
Diffstat (limited to 'clientapi/routing/sendevent.go')
-rw-r--r--clientapi/routing/sendevent.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go
index 90af9ac4..b1f8fa03 100644
--- a/clientapi/routing/sendevent.go
+++ b/clientapi/routing/sendevent.go
@@ -24,6 +24,7 @@ import (
"time"
"github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/matrix-org/util"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
@@ -117,7 +118,7 @@ func SendEvent(
// If we're sending a membership update, make sure to strip the authorised
// via key if it is present, otherwise other servers won't be able to auth
// the event if the room is set to the "restricted" join rule.
- if eventType == gomatrixserverlib.MRoomMember {
+ if eventType == spec.MRoomMember {
delete(r, "join_authorised_via_users_server")
}
@@ -136,7 +137,7 @@ func SendEvent(
timeToGenerateEvent := time.Since(startedGeneratingEvent)
// validate that the aliases exists
- if eventType == gomatrixserverlib.MRoomCanonicalAlias && stateKey != nil && *stateKey == "" {
+ if eventType == spec.MRoomCanonicalAlias && stateKey != nil && *stateKey == "" {
aliasReq := api.AliasEvent{}
if err = json.Unmarshal(e.Content(), &aliasReq); err != nil {
return util.ErrorResponse(fmt.Errorf("unable to parse alias event: %w", err))