Interface TypingApi


  • @Path("/_matrix/client/r0/rooms")
    @Consumes("application/json")
    @Produces("application/json")
    public interface TypingApi
    When a client receives an m.typing event, it MUST use the user ID list to REPLACE its knowledge of every user who is currently typing. The reason for this is that the server does not remember users who are not currently typing as that list gets big quickly. The client should mark as not typing any user ID who is not in that list.
    It is recommended that clients store a boolean indicating whether the user is typing or not. Whilst this value is true a timer should fire periodically every N seconds to send a typing HTTP request. The value of N is recommended to be no more than 20-30 seconds. This request should be re-sent by the client to continue informing the server the user is still typing. As subsequent requests will replace older requests, a safety margin of 5 seconds before the expected timeout runs out is recommended. When the user stops typing, the state change of the boolean to false should trigger another HTTP request to inform the server that the user has stopped typing.
    • Method Summary

      Modifier and Type Method Description
      void typing​(String roomId, String userId, TypingRequest 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)
      This tells the server that the user is typing for the next N milliseconds where N is the value specified in the timeout key.
    • Method Detail

      • typing

        @PUT
        @Path("/{roomId}/typing/{userId}")
        void typing​(@PathParam("roomId")
                    String roomId,
                    @PathParam("userId")
                    String userId,
                    TypingRequest 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)
        This tells the server that the user is typing for the next N milliseconds where N is the value specified in the timeout key. Alternatively, if typing is false, it tells the server that the user has stopped typing.
        Rate-limited: Yes.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The new typing state was set.

        Status code 429: This request was rate-limited.

        Parameters:
        roomId - Required. The user who has started to type.
        userId - Required. The room in which the user is typing.
        request - JSON body request.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.