aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage/sqlite3/storage.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-03-19 18:33:04 +0000
committerGitHub <noreply@github.com>2020-03-19 18:33:04 +0000
commitf2030286de4838f26cffbb2fb3f48f850dc7335a (patch)
tree1098b9bac8b15c189ed79524bf67dc429e34f076 /roomserver/storage/sqlite3/storage.go
parent944d454cb03445e7c173d1b44e4254f425d09b09 (diff)
Room server changes for room versions (#930)
* Rearrange state package a bit, add some code to look up the right state resolution algorithm * Remove shared * Add GetRoomVersionForRoomNID * Try to use room version to get correct state resolution algorithm * Fix room joins over federation * nolint resolveConflictsV2 because all attempts to break it up so far just result in it being awfully less obvious how it works * Rename Prepare to NewStateResolution * Update comments * Re-add missing tests
Diffstat (limited to 'roomserver/storage/sqlite3/storage.go')
-rw-r--r--roomserver/storage/sqlite3/storage.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/roomserver/storage/sqlite3/storage.go b/roomserver/storage/sqlite3/storage.go
index ae09a88a..28d608ca 100644
--- a/roomserver/storage/sqlite3/storage.go
+++ b/roomserver/storage/sqlite3/storage.go
@@ -901,6 +901,14 @@ func (d *Database) GetRoomVersionForRoom(
)
}
+func (d *Database) GetRoomVersionForRoomNID(
+ ctx context.Context, roomNID types.RoomNID,
+) (gomatrixserverlib.RoomVersion, error) {
+ return d.statements.selectRoomVersionForRoomNID(
+ ctx, nil, roomNID,
+ )
+}
+
type transaction struct {
ctx context.Context
txn *sql.Tx