Add AssignRoomNID to pre-assign roomNIDs (#3111)

This commit is contained in:
Till 2023-06-13 16:28:41 +02:00 committed by GitHub
parent 2c87972a3a
commit 7a2e325d10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 44 additions and 0 deletions

View file

@ -31,6 +31,7 @@ type Database interface {
UserRoomKeys
// Do we support processing input events for more than one room at a time?
SupportsConcurrentRoomInputs() bool
AssignRoomNID(ctx context.Context, roomID spec.RoomID, roomVersion gomatrixserverlib.RoomVersion) (roomNID types.RoomNID, err error)
// RoomInfo returns room information for the given room ID, or nil if there is no room.
RoomInfo(ctx context.Context, roomID string) (*types.RoomInfo, error)
RoomInfoByNID(ctx context.Context, roomNID types.RoomNID) (*types.RoomInfo, error)
@ -212,6 +213,7 @@ type UserRoomKeys interface {
type RoomDatabase interface {
EventDatabase
UserRoomKeys
AssignRoomNID(ctx context.Context, roomID spec.RoomID, roomVersion gomatrixserverlib.RoomVersion) (roomNID types.RoomNID, err error)
// RoomInfo returns room information for the given room ID, or nil if there is no room.
RoomInfo(ctx context.Context, roomID string) (*types.RoomInfo, error)
RoomInfoByNID(ctx context.Context, roomNID types.RoomNID) (*types.RoomInfo, error)