Add list of joined room members

This commit is contained in:
nxshock 2019-07-22 18:46:59 +05:00
parent 9c98ec1cf3
commit c179fdc4b6
2 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,7 @@ type Room struct {
topic string topic string
creator internal.User creator internal.User
joined []internal.User
events []RoomEvent events []RoomEvent

View File

@ -48,6 +48,8 @@ func (user *User) CreateRoom(request createroom.Request) (internal.Room, *models
Sender: user, Sender: user,
OriginServerTS: t}) OriginServerTS: t})
// TODO: Add join room event
// Set join rules event // Set join rules event
events = append(events, RoomEvent{ events = append(events, RoomEvent{
Content: []byte(request.Visibility), // TODO: check visibility vs join rules 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, name: request.Name,
topic: request.Topic, topic: request.Topic,
events: events, events: events,
creator: user} creator: user,
joined: []internal.User{user}}
for i, _ := range room.events { for i, _ := range room.events {
room.events[i].Room = room room.events[i].Room = room