mirror of https://github.com/matrix-org/gomatrix
Add Event
This commit is contained in:
parent
e5578b12c7
commit
015e6dc5a1
|
@ -615,6 +615,15 @@ func (cli *Client) UserTyping(roomID string, typing bool, timeout int64) (resp *
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Event gets a single event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with
|
||||||
|
// the HTTP response body, or return an error.
|
||||||
|
// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey
|
||||||
|
func (cli *Client) Event(roomID, eventID string, outContent interface{}) (err error) {
|
||||||
|
u := cli.BuildURL("rooms", roomID, "event", eventID)
|
||||||
|
err = cli.MakeRequest("GET", u, nil, outContent)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// StateEvent gets a single state event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with
|
// StateEvent gets a single state event in a room. It will attempt to JSON unmarshal into the given "outContent" struct with
|
||||||
// the HTTP response body, or return an error.
|
// the HTTP response body, or return an error.
|
||||||
// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey
|
// See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-state-eventtype-statekey
|
||||||
|
|
Loading…
Reference in New Issue