aboutsummaryrefslogtreecommitdiff
path: root/roomserver/api
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-05-31 15:27:08 +0000
committerGitHub <noreply@github.com>2023-05-31 15:27:08 +0000
commitcbdc601f1b6d1c2a648b69ff44b3a49916f4d31a (patch)
tree6d14c55508579211e3833cab60cfdfea3fab04a6 /roomserver/api
parent61341aca500ec4d87e5b6d4c3f965c3836d6e6d6 (diff)
Move CreateRoom logic to Roomserver (#3093)
Move create room logic over to roomserver.
Diffstat (limited to 'roomserver/api')
-rw-r--r--roomserver/api/api.go2
-rw-r--r--roomserver/api/perform.go24
2 files changed, 26 insertions, 0 deletions
diff --git a/roomserver/api/api.go b/roomserver/api/api.go
index 213e16e5..571aa40b 100644
--- a/roomserver/api/api.go
+++ b/roomserver/api/api.go
@@ -5,6 +5,7 @@ import (
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/spec"
+ "github.com/matrix-org/util"
asAPI "github.com/matrix-org/dendrite/appservice/api"
fsAPI "github.com/matrix-org/dendrite/federationapi/api"
@@ -169,6 +170,7 @@ type ClientRoomserverAPI interface {
GetRoomIDForAlias(ctx context.Context, req *GetRoomIDForAliasRequest, res *GetRoomIDForAliasResponse) error
GetAliasesForRoomID(ctx context.Context, req *GetAliasesForRoomIDRequest, res *GetAliasesForRoomIDResponse) error
+ PerformCreateRoom(ctx context.Context, userID spec.UserID, roomID spec.RoomID, createRequest *PerformCreateRoomRequest) (string, *util.JSONResponse)
// PerformRoomUpgrade upgrades a room to a newer version
PerformRoomUpgrade(ctx context.Context, roomID, userID string, roomVersion gomatrixserverlib.RoomVersion) (newRoomID string, err error)
PerformAdminEvacuateRoom(ctx context.Context, roomID string) (affected []string, err error)
diff --git a/roomserver/api/perform.go b/roomserver/api/perform.go
index c6e5f5a1..8d9742c6 100644
--- a/roomserver/api/perform.go
+++ b/roomserver/api/perform.go
@@ -1,6 +1,10 @@
package api
import (
+ "crypto/ed25519"
+ "encoding/json"
+ "time"
+
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/fclient"
@@ -8,6 +12,26 @@ import (
"github.com/matrix-org/util"
)
+type PerformCreateRoomRequest struct {
+ InvitedUsers []string
+ RoomName string
+ Visibility string
+ Topic string
+ StatePreset string
+ CreationContent json.RawMessage
+ InitialState []gomatrixserverlib.FledglingEvent
+ RoomAliasName string
+ RoomVersion gomatrixserverlib.RoomVersion
+ PowerLevelContentOverride json.RawMessage
+ IsDirect bool
+
+ UserDisplayName string
+ UserAvatarURL string
+ KeyID gomatrixserverlib.KeyID
+ PrivateKey ed25519.PrivateKey
+ EventTime time.Time
+}
+
type PerformJoinRequest struct {
RoomIDOrAlias string `json:"room_id_or_alias"`
UserID string `json:"user_id"`