Interface ReceiptApi
-
@Path("/_matrix/client/r0/rooms") @Produces("application/json") public interface ReceiptApi
This module adds in support for receipts. These receipts are a form of acknowledgement of an event. This module defines a single acknowledgement: m.read which indicates that the user has read up to a given event.
Sending a receipt for each event can result in sending large amounts of traffic to a homeserver. To prevent this from becoming a problem, receipts are implemented using "up to" markers. This marker indicates that the acknowledgement applies to all events "up to and including" the event specified. For example, marking an event as "read" would indicate that the user had read all events up to the referenced event.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ReceiptApi.Receipt
ReceiptContent types.
-
Method Summary
Modifier and Type Method Description void
readMarkers(String roomId, ReadMarkersRequest request, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
Sets the position of the read marker for a given room, and optionally the read receipt's location.void
receipt(String roomId, String receiptType, String eventId, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
This API updates the marker for the given receipt type to the event ID specified.
-
-
-
Method Detail
-
receipt
@POST @Path("/{roomId}/receipt/{receiptType}/{eventId}") void receipt(@PathParam("roomId") String roomId, @PathParam("receiptType") String receiptType, @PathParam("eventId") String eventId, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.HttpHeaders httpHeaders, @Suspended javax.ws.rs.container.AsyncResponse asyncResponse, @Context javax.ws.rs.core.SecurityContext securityContext)
This API updates the marker for the given receipt type to the event ID specified.
Rate-limited: Yes.
Requires auth: Yes.
Return:EmptyResponse
.Status code 200: The receipt was sent.
Status code 429: This request was rate-limited.
- Parameters:
roomId
- Required. The room in which to send the event.receiptType
- Required. The type of receipt to send. One of: ["m.read"]eventId
- Required. The event ID to acknowledge up to.uriInfo
- Request Information.httpHeaders
- Http headers.asyncResponse
- Asynchronous response.securityContext
- Security context.
-
readMarkers
@POST @Path("/{roomId}/read_markers") void readMarkers(@PathParam("roomId") String roomId, ReadMarkersRequest request, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.HttpHeaders httpHeaders, @Suspended javax.ws.rs.container.AsyncResponse asyncResponse, @Context javax.ws.rs.core.SecurityContext securityContext)
Sets the position of the read marker for a given room, and optionally the read receipt's location.
Rate-limited: Yes.
Requires auth: Yes.
Return:EmptyResponse
.Status code 200: The read marker, and read receipt if provided, have been updated.
Status code 429: This request was rate-limited.
- Parameters:
roomId
- Required. The room ID to set the read marker in for the user.request
- JSON body request.uriInfo
- Request Information.httpHeaders
- Http headers.asyncResponse
- Asynchronous response.securityContext
- Security context.
-
-