From 23e392adc507134e473a7f65bc659971fcd0ca84 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 21 Jul 2021 10:43:11 +0100 Subject: [PATCH] GMSL types --- clientapi/routing/createroom.go | 12 ++++++------ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clientapi/routing/createroom.go b/clientapi/routing/createroom.go index 977f7812d..15bb633e4 100644 --- a/clientapi/routing/createroom.go +++ b/clientapi/routing/createroom.go @@ -282,7 +282,7 @@ func createRoom( if r.Topic != "" { topicEvent = &fledglingEvent{ - Type: "m.room.topic", + Type: gomatrixserverlib.MRoomTopic, Content: eventutil.TopicContent{ Topic: r.Topic, }, @@ -291,7 +291,7 @@ func createRoom( if r.GuestCanJoin { guestAccessEvent = &fledglingEvent{ - Type: "m.room.guest_access", + Type: gomatrixserverlib.MRoomGuestAccess, Content: eventutil.GuestAccessContent{ GuestAccess: "can_join", }, @@ -333,13 +333,13 @@ func createRoom( case gomatrixserverlib.MRoomHistoryVisibility: historyVisibilityEvent = r.InitialState[i] - case "m.room.guest_access": + case gomatrixserverlib.MRoomGuestAccess: guestAccessEvent = &r.InitialState[i] case gomatrixserverlib.MRoomName: nameEvent = &r.InitialState[i] - case "m.room.topic": + case gomatrixserverlib.MRoomTopic: topicEvent = &r.InitialState[i] default: @@ -381,7 +381,7 @@ func createRoom( // TODO: bit of a chicken and egg problem here as the alias doesn't exist and cannot until we have made the room. // This means we might fail creating the alias but say the canonical alias is something that doesn't exist. // m.room.aliases is handled when we call roomserver.SetRoomAlias - eventsToMake = append(eventsToMake, fledglingEvent{"m.room.canonical_alias", "", eventutil.CanonicalAlias{Alias: roomAlias}}) + eventsToMake = append(eventsToMake, fledglingEvent{gomatrixserverlib.MRoomCanonicalAlias, "", eventutil.CanonicalAlias{Alias: roomAlias}}) } eventsToMake = append(eventsToMake, initialStateEvents...) @@ -477,7 +477,7 @@ func createRoom( fallthrough case gomatrixserverlib.MRoomCanonicalAlias: fallthrough - case "m.room.encryption": // TODO: move this to gmsl + case gomatrixserverlib.MRoomEncryption: fallthrough case gomatrixserverlib.MRoomMember: fallthrough diff --git a/go.mod b/go.mod index 6799dbf55..ec17e6444 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/matrix-org/go-http-js-libp2p v0.0.0-20200518170932-783164aeeda4 github.com/matrix-org/go-sqlite3-js v0.0.0-20210709140738-b0d1ba599a6d github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 - github.com/matrix-org/gomatrixserverlib v0.0.0-20210720141356-d52ec9c4dd2f + github.com/matrix-org/gomatrixserverlib v0.0.0-20210721094149-75792185bf42 github.com/matrix-org/naffka v0.0.0-20210623111924-14ff508b58e0 github.com/matrix-org/pinecone v0.0.0-20210623102758-74f885644c1b github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 diff --git a/go.sum b/go.sum index c93ce2474..86149343a 100644 --- a/go.sum +++ b/go.sum @@ -1027,8 +1027,8 @@ github.com/matrix-org/go-sqlite3-js v0.0.0-20210709140738-b0d1ba599a6d/go.mod h1 github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5dLDCud4r0r55eP4j9FuUNpl60Gmntcop4= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= -github.com/matrix-org/gomatrixserverlib v0.0.0-20210720141356-d52ec9c4dd2f h1:FP+tOVTX4mw4GPjHJE28UsPkw59ieISgjDtkCwb1vls= -github.com/matrix-org/gomatrixserverlib v0.0.0-20210720141356-d52ec9c4dd2f/go.mod h1:JsAzE1Ll3+gDWS9JSUHPJiiyAksvOOnGWF2nXdg4ZzU= +github.com/matrix-org/gomatrixserverlib v0.0.0-20210721094149-75792185bf42 h1:UsCdEX9G3svG07bBV8RKAWIyGzCgJpbX4BCP1n4ezH8= +github.com/matrix-org/gomatrixserverlib v0.0.0-20210721094149-75792185bf42/go.mod h1:JsAzE1Ll3+gDWS9JSUHPJiiyAksvOOnGWF2nXdg4ZzU= github.com/matrix-org/naffka v0.0.0-20210623111924-14ff508b58e0 h1:HZCzy4oVzz55e+cOMiX/JtSF2UOY1evBl2raaE7ACcU= github.com/matrix-org/naffka v0.0.0-20210623111924-14ff508b58e0/go.mod h1:sjyPyRxKM5uw1nD2cJ6O2OxI6GOqyVBfNXqKjBZTBZE= github.com/matrix-org/pinecone v0.0.0-20210623102758-74f885644c1b h1:5X5vdWQ13xrNkJVqaJHPsrt7rKkMJH5iac0EtfOuxSg=