aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage/shared
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 /roomserver/storage/shared
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 'roomserver/storage/shared')
-rw-r--r--roomserver/storage/shared/storage.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/roomserver/storage/shared/storage.go b/roomserver/storage/shared/storage.go
index 78bda95e..17095709 100644
--- a/roomserver/storage/shared/storage.go
+++ b/roomserver/storage/shared/storage.go
@@ -8,6 +8,7 @@ import (
"sort"
"github.com/matrix-org/gomatrixserverlib"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/matrix-org/util"
"github.com/tidwall/gjson"
@@ -905,7 +906,7 @@ func extractRoomVersionFromCreateEvent(event *gomatrixserverlib.Event) (
var err error
var roomVersion gomatrixserverlib.RoomVersion
// Look for m.room.create events.
- if event.Type() != gomatrixserverlib.MRoomCreate {
+ if event.Type() != spec.MRoomCreate {
return gomatrixserverlib.RoomVersion(""), nil
}
roomVersion = gomatrixserverlib.RoomVersionV1
@@ -949,7 +950,7 @@ func (d *EventDatabase) MaybeRedactEvent(
)
wErr := d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
- isRedactionEvent := event.Type() == gomatrixserverlib.MRoomRedaction && event.StateKey() == nil
+ isRedactionEvent := event.Type() == spec.MRoomRedaction && event.StateKey() == nil
if isRedactionEvent {
// an event which redacts itself should be ignored
if event.EventID() == event.Redacts() {
@@ -1044,7 +1045,7 @@ func (d *EventDatabase) loadRedactionPair(
var redactionEvent, redactedEvent *types.Event
var info *tables.RedactionInfo
var err error
- isRedactionEvent := event.Type() == gomatrixserverlib.MRoomRedaction && event.StateKey() == nil
+ isRedactionEvent := event.Type() == spec.MRoomRedaction && event.StateKey() == nil
var eventBeingRedacted string
if isRedactionEvent {
@@ -1469,7 +1470,7 @@ func (d *Database) GetLocalServerInRoom(ctx context.Context, roomNID types.RoomN
}
// GetServerInRoom returns true if we think a server is in a given room or false otherwise.
-func (d *Database) GetServerInRoom(ctx context.Context, roomNID types.RoomNID, serverName gomatrixserverlib.ServerName) (bool, error) {
+func (d *Database) GetServerInRoom(ctx context.Context, roomNID types.RoomNID, serverName spec.ServerName) (bool, error) {
return d.MembershipTable.SelectServerInRoom(ctx, nil, roomNID, serverName)
}