mirror of https://github.com/matrix-org/gomatrix
Read receipt resp/req/client functions which resolves #51
This commit is contained in:
parent
eb6a57bae9
commit
b7c900e0bb
|
@ -493,6 +493,15 @@ func (cli *Client) SendNotice(roomID, text string) (*RespSendEvent, error) {
|
|||
TextMessage{"m.notice", text})
|
||||
}
|
||||
|
||||
// Receipt updates the marker for the given receipt type to the event ID specified.
|
||||
// See https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-receipt-receipttype-eventid
|
||||
func (cli *Client) Receipt(roomID, receiptType, eventID string, req *ReqReceipt) (resp *RespReceipt, err error) {
|
||||
urlPath := cli.BuildURL("rooms", roomID, "receipt", receiptType, eventID)
|
||||
_, err = cli.MakeRequest("POST", urlPath, req, nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// RedactEvent redacts the given event. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid
|
||||
func (cli *Client) RedactEvent(roomID, eventID string, req *ReqRedact) (resp *RespSendEvent, err error) {
|
||||
txnID := txnID()
|
||||
|
|
|
@ -76,3 +76,7 @@ type ReqTyping struct {
|
|||
Typing bool `json:"typing"`
|
||||
Timeout int64 `json:"timeout"`
|
||||
}
|
||||
|
||||
// ReqReceipt is the JSON request for https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-receipt-receipttype-eventid
|
||||
type ReqReceipt struct {
|
||||
}
|
||||
|
|
|
@ -174,3 +174,7 @@ type RespTurnServer struct {
|
|||
TTL int `json:"ttl"`
|
||||
URIs []string `json:"uris"`
|
||||
}
|
||||
|
||||
// RespReceipt is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-receipt-receipttype-eventid
|
||||
type RespReceipt struct {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue