aboutsummaryrefslogtreecommitdiff
path: root/appservice
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 /appservice
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 'appservice')
-rw-r--r--appservice/appservice.go5
-rw-r--r--appservice/appservice_test.go6
-rw-r--r--appservice/consumers/roomserver.go7
3 files changed, 9 insertions, 9 deletions
diff --git a/appservice/appservice.go b/appservice/appservice.go
index 1f6037ee..d94a483e 100644
--- a/appservice/appservice.go
+++ b/appservice/appservice.go
@@ -20,10 +20,9 @@ import (
"github.com/matrix-org/dendrite/setup/jetstream"
"github.com/matrix-org/dendrite/setup/process"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/sirupsen/logrus"
- "github.com/matrix-org/gomatrixserverlib"
-
appserviceAPI "github.com/matrix-org/dendrite/appservice/api"
"github.com/matrix-org/dendrite/appservice/consumers"
"github.com/matrix-org/dendrite/appservice/query"
@@ -86,7 +85,7 @@ func NewInternalAPI(
func generateAppServiceAccount(
userAPI userapi.AppserviceUserAPI,
as config.ApplicationService,
- serverName gomatrixserverlib.ServerName,
+ serverName spec.ServerName,
) error {
var accRes userapi.PerformAccountCreationResponse
err := userAPI.PerformAccountCreation(context.Background(), &userapi.PerformAccountCreationRequest{
diff --git a/appservice/appservice_test.go b/appservice/appservice_test.go
index 282c6312..878ca566 100644
--- a/appservice/appservice_test.go
+++ b/appservice/appservice_test.go
@@ -27,7 +27,7 @@ import (
"github.com/matrix-org/dendrite/setup/jetstream"
"github.com/matrix-org/dendrite/test"
"github.com/matrix-org/dendrite/userapi"
- "github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/matrix-org/dendrite/test/testrig"
)
@@ -326,7 +326,7 @@ func TestRoomserverConsumerOneInvite(t *testing.T) {
room := test.NewRoom(t, alice)
// Invite Bob
- room.CreateAndInsert(t, alice, gomatrixserverlib.MRoomMember, map[string]interface{}{
+ room.CreateAndInsert(t, alice, spec.MRoomMember, map[string]interface{}{
"membership": "invite",
}, test.WithStateKey(bob.ID))
@@ -345,7 +345,7 @@ func TestRoomserverConsumerOneInvite(t *testing.T) {
t.Fatal(err)
}
for _, ev := range txn.Events {
- if ev.Type != gomatrixserverlib.MRoomMember {
+ if ev.Type != spec.MRoomMember {
continue
}
// Usually we would check the event content for the membership, but since
diff --git a/appservice/consumers/roomserver.go b/appservice/consumers/roomserver.go
index 586ca33a..8ca8220d 100644
--- a/appservice/consumers/roomserver.go
+++ b/appservice/consumers/roomserver.go
@@ -26,6 +26,7 @@ import (
"time"
"github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/nats-io/nats.go"
"github.com/matrix-org/dendrite/roomserver/api"
@@ -240,7 +241,7 @@ func (s *OutputRoomEventConsumer) appserviceIsInterestedInEvent(ctx context.Cont
return true
}
- if event.Type() == gomatrixserverlib.MRoomMember && event.StateKey() != nil {
+ if event.Type() == spec.MRoomMember && event.StateKey() != nil {
if appservice.IsInterestedInUserID(*event.StateKey()) {
return true
}
@@ -286,7 +287,7 @@ func (s *OutputRoomEventConsumer) appserviceJoinedAtEvent(ctx context.Context, e
switch {
case ev.StateKey == nil:
continue
- case ev.Type != gomatrixserverlib.MRoomMember:
+ case ev.Type != spec.MRoomMember:
continue
}
var membership gomatrixserverlib.MemberContent
@@ -294,7 +295,7 @@ func (s *OutputRoomEventConsumer) appserviceJoinedAtEvent(ctx context.Context, e
switch {
case err != nil:
continue
- case membership.Membership == gomatrixserverlib.Join:
+ case membership.Membership == spec.Join:
if appservice.IsInterestedInUserID(*ev.StateKey) {
return true
}