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.
        Returns:

        Result.Success if the precondition is fulfilled, Result.Failure otherwise.

      • 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.
        Returns:

        Result.Success if the precondition is fulfilled, Result.Failure otherwise.

      • 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.
        Returns:

        Result.Success if the precondition is fulfilled, Result.Failure otherwise.

      • 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.
      • onQueryChannelsPrecondition

         Result<Unit> onQueryChannelsPrecondition(QueryChannelsRequest request)

        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:
        request - QueryChannelRequest which is going to be used for the request.
        Returns:

        Result.Success if precondition passes otherwise Result.Failure

      • 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.
        Returns:

        Result having Unit if precondition passes otherwise Error describing what went wrong.

      • 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.
        Returns:

        Result.Success if precondition passes otherwise Result.Failure

      • 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.
        Returns:

        Result.Success if precondition passes, otherwise Result.Failure.

      • onCreateChannelRequest

        @Deprecated(message = "Use CreateChannelListener.onCreateChannelRequest(channelType, channelId, request, currentUser) instead", replaceWith = @ReplaceWith(imports = {"io.getstream.chat.android.client.plugin.listeners.CreateChannelListener"}, expression = "onCreateChannelRequest(String, String, CreateChannelParams, User)"), level = DeprecationLevel.WARNING) 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.
      • onCreateChannelRequest

         Unit onCreateChannelRequest(String channelType, String channelId, CreateChannelParams params, User currentUser)

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

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        params - The request holding the required data for creating a channel.
        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.
        Returns:

        Result.Success if the precondition is fulfilled, Result.Failure otherwise.

      • onDeleteChannelRequest

         Unit onDeleteChannelRequest(User currentUser, String channelType, String channelId)

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

        Parameters:
        currentUser - The currently logged in user.
        channelType - The channel type.
        channelId - The channel id.
      • onDeleteChannelResult

         Unit onDeleteChannelResult(String channelType, String channelId, Result<Channel> result)

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

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        result - The API call result.
      • onDeleteChannelPrecondition

         Result<Unit> onDeleteChannelPrecondition(User currentUser, String channelType, String channelId)

        Runs precondition check for ChatClient.deleteChannel. 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.
        channelType - The channel type.
        channelId - The channel id.
        Returns:

        Result.Success if the precondition is fulfilled, Result.Failure otherwise.

      • 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.
      • onQueryThreadsPrecondition

         Result<Unit> onQueryThreadsPrecondition(QueryThreadsRequest request)

        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:
        request - QueryThreadsRequest which is going to be used for the request.
        Returns:

        Result.Success if precondition passes otherwise Result.Failure

      • onQueryThreadsResult

         Unit onQueryThreadsResult(Result<QueryThreadsResult> result, QueryThreadsRequest request)

        Runs side effect the request was completed.

        Parameters:
        result - The Result containing the successfully retrieved QueryThreadsResult or the error.
        request - QueryThreadsRequest which is was used for the request.
      • onBlockUserResult

         Unit onBlockUserResult(Result<UserBlock> result)

        Runs side effect after the request was completed.

        Parameters:
        result - The Result containing the successfully retrieved UserBlock or the error.
      • onUnblockUserResult

         Unit onUnblockUserResult(String userId, Result<Unit> result)

        Runs side effect after the request was completed.

        Parameters:
        userId - The id of the user that was unblocked.
        result - The Result of the unblock operation.
      • onQueryBlockedUsersResult

         Unit onQueryBlockedUsersResult(Result<List<UserBlock>> result)

        Runs side effect after the request was completed.

        Parameters:
        result - The Result containing the successfully retrieved list of blocked users or the error.
      • onCreateDraftMessageResult

         Unit onCreateDraftMessageResult(Result<DraftMessage> result, String channelType, String channelId, DraftMessage 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 created.
        channelId - The id of the the channel in which message is created.
        message - DraftMessage to be created.
      • onDeleteDraftMessagesResult

         Unit onDeleteDraftMessagesResult(Result<Unit> result, String channelType, String channelId, DraftMessage 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 updated.
        channelId - The id of the the channel in which message is updated.
        message - DraftMessage to be updated.
      • onQueryDraftMessagesResult

         Unit onQueryDraftMessagesResult(Result<List<DraftMessage>> result, Integer offset, Integer limit)

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

        Parameters:
        result - Result response from the original request.
        offset - The offset of the query.
        limit - The limit of the query.
      • onQueryDraftMessagesResult

         Unit onQueryDraftMessagesResult(Result<QueryDraftsResult> result, FilterObject filter, Integer limit, String next, QuerySorter<DraftsSort> sort)

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

        Parameters:
        result - Result response from the original request.
        filter - The filter object used in the query.
        limit - The limit of the query.
        next - The next page token.
        sort - The sorter used in the query.
      • onUpdateLiveLocationPrecondition

         Result<Unit> onUpdateLiveLocationPrecondition(Location location)

        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:
        location - The location to be updated.
        Returns:

        Result.Success if precondition passes, otherwise Result.Failure.