diff --git a/internal/backends/memory/rooms.go b/internal/backends/memory/rooms.go index 9349b2d..80de6b6 100644 --- a/internal/backends/memory/rooms.go +++ b/internal/backends/memory/rooms.go @@ -16,6 +16,7 @@ type Room struct { topic string creator internal.User + joined []internal.User events []RoomEvent diff --git a/internal/backends/memory/user.go b/internal/backends/memory/user.go index 2726ac7..eb0e39c 100644 --- a/internal/backends/memory/user.go +++ b/internal/backends/memory/user.go @@ -48,6 +48,8 @@ func (user *User) CreateRoom(request createroom.Request) (internal.Room, *models Sender: user, OriginServerTS: t}) + // TODO: Add join room event + // Set join rules event events = append(events, RoomEvent{ Content: []byte(request.Visibility), // TODO: check visibility vs join rules @@ -82,7 +84,8 @@ func (user *User) CreateRoom(request createroom.Request) (internal.Room, *models name: request.Name, topic: request.Topic, events: events, - creator: user} + creator: user, + joined: []internal.User{user}} for i, _ := range room.events { room.events[i].Room = room