Users can now create a new room directly in Gomuks
Added the ability to create a room from within gomuks using the now `/create` command. This comman takes the room name followed by the alias. Room name may contain spaces but the alias may not as per the Matrix alias conventions. Also update `/help` to include the new command.
This commit is contained in:
@ -538,6 +538,16 @@ func (c *Container) SendTyping(roomID string, typing bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// CreateRoom attempts to create a new room and join the user.
|
||||
func (c *Container) CreateRoom(req *mautrix.ReqCreateRoom) (*rooms.Room, error) {
|
||||
resp, err := c.client.CreateRoom(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
room := c.GetRoom(resp.RoomID)
|
||||
return room, nil
|
||||
}
|
||||
|
||||
// JoinRoom makes the current user try to join the given room.
|
||||
func (c *Container) JoinRoom(roomID, server string) (*rooms.Room, error) {
|
||||
resp, err := c.client.JoinRoom(roomID, server, nil)
|
||||
|
Reference in New Issue
Block a user