mirror of https://github.com/matrix-org/gomatrix
rejig
This commit is contained in:
parent
48858059f1
commit
5f2b2fc843
13
responses.go
13
responses.go
|
@ -30,19 +30,6 @@ type RespPublicRooms struct {
|
||||||
Chunk []PublicRoom `json:"chunk"`
|
Chunk []PublicRoom `json:"chunk"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PublicRooms is a part of RespPublicRooms representing the disclosed information regarding a public room
|
|
||||||
type PublicRoom struct {
|
|
||||||
CanonicalAlias string `json:"canonical_alias"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
WorldReadable bool `json:"world_readable"`
|
|
||||||
Topic string `json:"topic"`
|
|
||||||
NumJoinedMembers int `json:"num_joined_members"`
|
|
||||||
AvatarURL string `json:"avatar_url"`
|
|
||||||
RoomID string `json:"room_id"`
|
|
||||||
GuestCanJoin bool `json:"guest_can_join"`
|
|
||||||
Aliases []string `json:"aliases"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// RespJoinRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-join
|
// RespJoinRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-join
|
||||||
type RespJoinRoom struct {
|
type RespJoinRoom struct {
|
||||||
RoomID string `json:"room_id"`
|
RoomID string `json:"room_id"`
|
||||||
|
|
13
room.go
13
room.go
|
@ -6,6 +6,19 @@ type Room struct {
|
||||||
State map[string]map[string]*Event
|
State map[string]map[string]*Event
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PublicRoom represents the information about a public room obtainable from the room directory
|
||||||
|
type PublicRoom struct {
|
||||||
|
CanonicalAlias string `json:"canonical_alias"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
WorldReadable bool `json:"world_readable"`
|
||||||
|
Topic string `json:"topic"`
|
||||||
|
NumJoinedMembers int `json:"num_joined_members"`
|
||||||
|
AvatarURL string `json:"avatar_url"`
|
||||||
|
RoomID string `json:"room_id"`
|
||||||
|
GuestCanJoin bool `json:"guest_can_join"`
|
||||||
|
Aliases []string `json:"aliases"`
|
||||||
|
}
|
||||||
|
|
||||||
// UpdateState updates the room's current state with the given Event. This will clobber events based
|
// UpdateState updates the room's current state with the given Event. This will clobber events based
|
||||||
// on the type/state_key combination.
|
// on the type/state_key combination.
|
||||||
func (room Room) UpdateState(event *Event) {
|
func (room Room) UpdateState(event *Event) {
|
||||||
|
|
Loading…
Reference in New Issue