Matrix/entities/room/room.go

97 lines
3.6 KiB
Go
Raw Normal View History

2020-09-28 20:37:02 +00:00
package room
2020-10-12 14:16:28 +00:00
import "git.nutfactory.org/hoernschen/Matrix/entities/event"
2020-09-28 20:37:02 +00:00
type Room struct {
2020-10-11 21:11:30 +00:00
Id string `json:"id,omitempty"`
Version string `json:"version,omitempty"`
Name string `json:"name,omitempty"`
Topic string `json:"topic,omitempty"`
Members []string `json:"members,omitempty"`
Servers []string
Events map[string]*event.Event `json:"events,omitempty"`
Visibility string `json:"visibility,omitempty"`
IsDirect bool `json:"is_direct,omitempty"`
Federated bool `json:"federated,omitempty"`
2020-09-28 20:37:02 +00:00
}
2020-10-11 21:11:30 +00:00
2020-10-12 14:16:28 +00:00
type CreateRoomRequest struct {
2020-10-11 21:11:30 +00:00
Visibility string `json:"visibility,omitempty"`
RoomAliasName string `json:"room_alias_name,omitempty"`
Name string `json:"name,omitempty"`
Topic string `json:"topic,omitempty"`
Invite string `json:"invite,omitempty"`
Invite3pid invite3pid `json:"invite_3pid,omitempty"`
RoomVersion string `json:"room_version,omitempty"`
2020-10-12 14:16:28 +00:00
CreationContent CreationContent `json:"creation_content,omitempty"`
2020-10-11 21:11:30 +00:00
InitialState []event.StateEvent `json:"initial_state,omitempty"`
Preset string `json:"preset,omitempty"`
IsDirect bool `json:"is_direct,omitempty"`
PowerLevelContentOverride string `json:"power_level_content_override,omitempty"`
}
2020-10-12 14:16:28 +00:00
type CreateRoomResponse struct {
2020-10-11 21:11:30 +00:00
RoomId string `json:"room_id,omitempty"`
}
type getRoomMemberResponse struct {
Chunk []*event.Event `json:"chunk,omitempty"`
}
2020-10-12 14:16:28 +00:00
type JoinRoomUserRequest struct {
2020-10-11 21:11:30 +00:00
ThirdPartySigned thirdPartySigned `json:"third_party_signed,omitempty"`
}
2020-10-12 14:16:28 +00:00
type JoinRoomUserResponse struct {
2020-10-11 21:11:30 +00:00
RoomId string `json:"room_id,omitempty"`
}
type makeJoinResponse struct {
RoomVersion string `json:"room_version,omitempty"`
Event event.Event `json:"event,omitempty"`
}
type joinRoomServerRequest struct {
Sender string `json:"sender,omitempty"`
Origin string `json:"origin,omitempty"`
Timestamp int64 `json:"origin_server_ts,omitempty"`
EventType string `json:"type,omitempty"`
StateKey string `json:"state_key,omitempty"`
Content event.MemberEventContent `json:"content,omitempty"`
}
type joinRoomServerResponse struct {
Origin string `json:"origin,omitempty"`
AuthChain []*event.Event `json:"auth_chain,omitempty"`
State []*event.Event `json:"state,omitempty"`
}
type invite3pid struct {
IdServer string `json:"id_server,omitempty"`
IdAccessToken string `json:"id_access_token,omitempty"`
Medium string `json:"medium,omitempty"`
Address string `json:"address,omitempty"`
}
2020-10-12 14:16:28 +00:00
type CreationContent struct {
2020-10-11 21:11:30 +00:00
Federated bool `json:"m.federate,omitempty"`
}
type unsignedData struct {
Age int `json:"age,omitempty"`
RedactedBecause *event.Event `json:"redacted_because,omitempty"`
TransactionId string `json:"transaction_id,omitempty"`
}
type invite struct {
DisplayName string `json:"display_name,omitempty"`
Signed thirdPartySigned `json:"signed,omitempty"`
}
type thirdPartySigned struct {
2020-10-17 10:07:39 +00:00
Sender string `json:"sender,omitempty"`
MXID string `json:"mxid,omitempty"`
Signatures map[string]map[string]string `json:"signatures,omitempty"`
Token string `json:"token,omitempty"`
2020-10-11 21:11:30 +00:00
}