Interface Plugin

    • Constructor Detail

    • Method Detail

      • onQueryMembersResult

         Unit onQueryMembersResult(Result<List<Member>> result, String channelType, String channelId, Integer offset, Integer limit, FilterObject filter, QuerySorter<Member> sort, List<Member> members)

        Runs this function on the Result of this request.

        Parameters:
        result - Result of this request.
        channelType - The type of channel.
        channelId - The id of the channel.
        offset - Offset limit.
        limit - Number of members to fetch.
        filter - FilterObject to filter members of certain type.
        sort - Sort the list of members.
        members - List of members.
      • onDeleteReactionRequest

         Unit onDeleteReactionRequest(String cid, String messageId, String reactionType, User currentUser)

        A method called before making an API call to delete the reaction.

        Parameters:
        cid - The full channel id, i.e.
        messageId - The id of the message to which reaction belongs.
        reactionType - The type of reaction.
        currentUser - The currently logged in user.
      • onDeleteReactionResult

         Unit onDeleteReactionResult(String cid, String messageId, String reactionType, User currentUser, Result<Message> result)

        A method called after receiving the response from the delete reaction call.

        Parameters:
        cid - The full channel id, i.e.
        messageId - The id of the message to which reaction belongs.
        reactionType - The type of reaction.
        currentUser - The currently logged in user.
        result - The API call result.
      • onDeleteReactionPrecondition

         Result<Unit> onDeleteReactionPrecondition(User currentUser)

        Runs precondition check for ChatClient.deleteReaction. The request will be run if the method returns Result.Success and won't be made if it returns Result.Failure.

        Parameters:
        currentUser - The currently logged in user.
      • onSendReactionRequest

         Unit onSendReactionRequest(String cid, Reaction reaction, Boolean enforceUnique, User currentUser)

        A method called before making an API call to send the reaction.

        Parameters:
        cid - The full channel id, i.e.
        reaction - The Reaction to send.
        enforceUnique - Flag to determine whether the reaction should replace other ones added by the current user.
        currentUser - The currently logged in user.
      • onSendReactionResult

         Unit onSendReactionResult(String cid, Reaction reaction, Boolean enforceUnique, User currentUser, Result<Reaction> result)

        A method called after receiving the response from the send reaction call.

        Parameters:
        cid - The full channel id, i.e.
        reaction - The Reaction to send.
        enforceUnique - Flag to determine whether the reaction should replace other ones added by the current user.
        currentUser - The currently logged in user.
        result - The API call result.
      • onSendReactionPrecondition

         Result<Unit> onSendReactionPrecondition(User currentUser, Reaction reaction)

        Runs precondition check for ChatClient.sendReaction. The request will be run if the method returns Result.Success and won't be made if it returns Result.Failure.

        Parameters:
        currentUser - The currently logged in user.
        reaction - The Reaction to send.
      • onGiphySendResult

         Unit onGiphySendResult(String cid, Result<Message> result)

        A method called after receiving the response from the send Giphy call.

        Parameters:
        cid - The full channel id, i.e.
        result - The API call result.
      • onShuffleGiphyResult

         Unit onShuffleGiphyResult(String cid, Result<Message> result)

        A method called after receiving the response from the shuffle Giphy call.

        Parameters:
        cid - The full channel id, i.e.
        result - The API call result.
      • onMessageDeletePrecondition

         Result<Unit> onMessageDeletePrecondition(String messageId)

        Runs precondition check for ChatClient.deleteMessage. The request will be run if the method returns Result.Success and won't be made if it returns Result.Failure.

        Parameters:
        messageId - The message id to be deleted.
      • onMessageDeleteResult

         Unit onMessageDeleteResult(String originalMessageId, Result<Message> result)

        Method called when a request for message deletion return. Use it to update database, update messages or to present an error to the user.

        Parameters:
        result - the result of the API call.
      • onMessageSendResult

         Unit onMessageSendResult(Result<Message> result, String channelType, String channelId, Message message)

        Side effect to be invoked when the original request is completed with a response.

        Parameters:
        result - Result response from the original request.
        channelType - The type of the channel in which message is sent.
        channelId - The id of the the channel in which message is sent.
        message - Message to be sent.
      • onMessageEditRequest

         Unit onMessageEditRequest(Message message)

        Method called when a request for message edition happens. Use it to update database, update messages in the SDK, update the UI when a message occurs...

        Parameters:
        message - Message.
      • onMessageEditResult

         Unit onMessageEditResult(Message originalMessage, Result<Message> result)

        Method called when a request for message edition return. Use it to update database, update messages or to present an error to the user.

        Parameters:
        result - the result of the API call.
      • onTypingEventPrecondition

         Result<Unit> onTypingEventPrecondition(String eventType, String channelType, String channelId, Map<Object, Object> extraData, Date eventTime)

        Runs this precondition before ChatClient.keystroke and ChatClient.stopTyping request is invoked.

        Parameters:
        eventType - Type of the event that can be one of the EventType.
        channelType - Type of the channel in which the event is sent.
        channelId - Id of the channel in which the event is sent.
        extraData - Any extra data such as parent id.
        eventTime - Date object as the time of this event.
      • onTypingEventRequest

         Unit onTypingEventRequest(String eventType, String channelType, String channelId, Map<Object, Object> extraData, Date eventTime)

        Runs this side effect before ChatClient.keystroke and ChatClient.stopTyping request is invoked.

        Parameters:
        eventType - Type of the event that can be one of the EventType.
        channelType - Type of the channel in which the event is sent.
        channelId - Id of the channel in which the event is sent.
        extraData - Any extra data such as parent id.
        eventTime - Date object as the time of this event.
      • onTypingEventResult

         Unit onTypingEventResult(Result<ChatEvent> result, String eventType, String channelType, String channelId, Map<Object, Object> extraData, Date eventTime)

        Runs this side effect after ChatClient.keystroke and ChatClient.stopTyping request is completed.

        Parameters:
        result - Result of the original request.
        eventType - Type of the event that can be one of the EventType.
        channelType - Type of the channel in which the event is sent.
        channelId - Id of the channel in which the event is sent.
        extraData - Any extra data such as parent id.
        eventTime - Date object as the time of this event.
      • onHideChannelPrecondition

         Result<Unit> onHideChannelPrecondition(String channelType, String channelId, Boolean clearHistory)

        Run precondition for the request. If it returns Result.Success then the request is run otherwise it returns Result.Failure and no request is made.

        Parameters:
        channelType - Type of the requested channel.
        channelId - Id of the requested channel.
        clearHistory - Boolean, if you want to clear the history of this channel or not.
      • onHideChannelRequest

         Unit onHideChannelRequest(String channelType, String channelId, Boolean clearHistory)

        Runs side effect before the request is launched.

        Parameters:
        channelType - Type of the requested channel.
        channelId - Id of the requested channel.
        clearHistory - Boolean, if you want to clear the history of this channel or not.
      • onHideChannelResult

         Unit onHideChannelResult(Result<Unit> result, String channelType, String channelId, Boolean clearHistory)

        Runs this function on the result of the request.

        Parameters:
        result - Result of this request.
        channelType - Type of the requested channel.
        channelId - Id of the requested channel.
        clearHistory - Boolean, if you want to clear the history of this channel or not.
      • onChannelMarkReadPrecondition

         Result<Unit> onChannelMarkReadPrecondition(String channelType, String channelId)

        Run precondition for the request. If it returns Result.Success then the request is run otherwise it returns Result.Failure and no request is made.

        Parameters:
        channelType - Type of the channel to mark as read.
        channelId - Id of the channel to mark as read.
      • onCreateChannelRequest

         Unit onCreateChannelRequest(String channelType, String channelId, List<String> memberIds, Map<String, Object> extraData, User currentUser)

        A method called before making an API call to create a channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        memberIds - The list of members' ids.
        extraData - Map of key-value pairs that let you store extra data
        currentUser - The currently logged in user.
      • onCreateChannelResult

         Unit onCreateChannelResult(String channelType, String channelId, List<String> memberIds, Result<Channel> result)

        A method called after receiving the response from the create channel call.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        memberIds - The list of members' ids.
        result - The API call result.
      • onCreateChannelPrecondition

         Result<Unit> onCreateChannelPrecondition(User currentUser, String channelId, List<String> memberIds)

        Runs precondition check for ChatClient.createChannel. The request will be run if the method returns Result.Success and won't be made if it returns Result.Failure.

        Parameters:
        currentUser - The currently logged in user.
        channelId - The channel id.
        memberIds - The list of members' ids.
      • onAttachmentSendRequest

         Unit onAttachmentSendRequest(String channelType, String channelId, Message message)

        Updates the SDK before the attachments are sent to backend. It can be used to update the database with the message whose attachments are going to be sent or to change the state of the messages that are presented to the end user.

        Parameters:
        channelType - String
        channelId - String
        message - Message
      • onGetMessageResult

         Unit onGetMessageResult(String messageId, Result<Message> result)

        Method called when the API call requesting a single new message has completed.

        Use it to update the database accordingly.

        Parameters:
        messageId - The ID of the message we are fetching.
        result - The result of the API call.