aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage/interface.go
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-06-06 20:55:18 +0000
committerGitHub <noreply@github.com>2023-06-06 20:55:18 +0000
commit7a1fd7f512ce06a472a2051ee63eae4a270eb71a (patch)
tree20128b0d3f7c69dd776aa7b2b9bc3194dda7dd75 /roomserver/storage/interface.go
parent725ff5567d2a3bc9992b065e72ccabefb595ec1c (diff)
PDU Sender split (#3100)
Initial cut of splitting PDU Sender into SenderID & looking up UserID where required.
Diffstat (limited to 'roomserver/storage/interface.go')
-rw-r--r--roomserver/storage/interface.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/roomserver/storage/interface.go b/roomserver/storage/interface.go
index 7d22df00..2d007bed 100644
--- a/roomserver/storage/interface.go
+++ b/roomserver/storage/interface.go
@@ -166,6 +166,10 @@ type Database interface {
GetServerInRoom(ctx context.Context, roomNID types.RoomNID, serverName spec.ServerName) (bool, error)
// GetKnownUsers searches all users that userID knows about.
GetKnownUsers(ctx context.Context, userID, searchString string, limit int) ([]string, error)
+ // GetKnownUsers tries to obtain the current mxid for a given user.
+ GetUserIDForSender(ctx context.Context, roomID string, senderID string) (*spec.UserID, error)
+ // GetKnownUsers tries to obtain the current senderID for a given user.
+ GetSenderIDForUser(ctx context.Context, roomID string, userID spec.UserID) (string, error)
// GetKnownRooms returns a list of all rooms we know about.
GetKnownRooms(ctx context.Context) ([]string, error)
// ForgetRoom sets a flag in the membership table, that the user wishes to forget a specific room
@@ -211,6 +215,7 @@ type RoomDatabase interface {
GetOrCreateEventTypeNID(ctx context.Context, eventType string) (eventTypeNID types.EventTypeNID, err error)
GetOrCreateEventStateKeyNID(ctx context.Context, eventStateKey *string) (types.EventStateKeyNID, error)
GetStateEvent(ctx context.Context, roomID, evType, stateKey string) (*types.HeaderedEvent, error)
+ GetUserIDForSender(ctx context.Context, roomID string, senderID string) (*spec.UserID, error)
}
type EventDatabase interface {