-
- All Implemented Interfaces:
-
io.getstream.chat.android.client.plugin.DependencyResolver,io.getstream.chat.android.client.plugin.listeners.BlockUserListener,io.getstream.chat.android.client.plugin.listeners.ChannelMarkReadListener,io.getstream.chat.android.client.plugin.listeners.CreateChannelListener,io.getstream.chat.android.client.plugin.listeners.DeleteChannelListener,io.getstream.chat.android.client.plugin.listeners.DeleteMessageForMeListener,io.getstream.chat.android.client.plugin.listeners.DeleteMessageListener,io.getstream.chat.android.client.plugin.listeners.DeleteReactionListener,io.getstream.chat.android.client.plugin.listeners.DraftMessageListener,io.getstream.chat.android.client.plugin.listeners.EditMessageListener,io.getstream.chat.android.client.plugin.listeners.FetchCurrentUserListener,io.getstream.chat.android.client.plugin.listeners.GetMessageListener,io.getstream.chat.android.client.plugin.listeners.HideChannelListener,io.getstream.chat.android.client.plugin.listeners.LiveLocationListener,io.getstream.chat.android.client.plugin.listeners.MarkAllReadListener,io.getstream.chat.android.client.plugin.listeners.PushPreferencesListener,io.getstream.chat.android.client.plugin.listeners.QueryBlockedUsersListener,io.getstream.chat.android.client.plugin.listeners.QueryChannelListener,io.getstream.chat.android.client.plugin.listeners.QueryChannelsListener,io.getstream.chat.android.client.plugin.listeners.QueryGroupedChannelsListener,io.getstream.chat.android.client.plugin.listeners.QueryMembersListener,io.getstream.chat.android.client.plugin.listeners.QueryThreadsListener,io.getstream.chat.android.client.plugin.listeners.SendAttachmentListener,io.getstream.chat.android.client.plugin.listeners.SendGiphyListener,io.getstream.chat.android.client.plugin.listeners.SendMessageListener,io.getstream.chat.android.client.plugin.listeners.SendReactionListener,io.getstream.chat.android.client.plugin.listeners.ShuffleGiphyListener,io.getstream.chat.android.client.plugin.listeners.ThreadQueryListener,io.getstream.chat.android.client.plugin.listeners.TypingEventListener,io.getstream.chat.android.client.plugin.listeners.UnblockUserListener
public interface Plugin implements DependencyResolver, QueryMembersListener, DeleteReactionListener, SendReactionListener, ThreadQueryListener, SendGiphyListener, ShuffleGiphyListener, DeleteMessageListener, DraftMessageListener, SendMessageListener, SendAttachmentListener, EditMessageListener, QueryChannelListener, QueryChannelsListener, QueryGroupedChannelsListener, TypingEventListener, HideChannelListener, MarkAllReadListener, ChannelMarkReadListener, CreateChannelListener, DeleteChannelListener, GetMessageListener, FetchCurrentUserListener, QueryThreadsListener, BlockUserListener, UnblockUserListener, QueryBlockedUsersListener, LiveLocationListener, PushPreferencesListener, DeleteMessageForMeListener
Plugin is an extension for ChatClient.
-
-
Method Summary
Modifier and Type Method Description ErrorHandlergetErrorHandler()UnitonQueryMembersResult(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. UnitonDeleteReactionRequest(String cid, String messageId, String reactionType, User currentUser)A method called before making an API call to delete the reaction. UnitonDeleteReactionResult(String cid, String messageId, String reactionType, User currentUser, Result<Message> result)A method called after receiving the response from the delete reaction call. Result<Unit>onDeleteReactionPrecondition(User currentUser)Runs precondition check for ChatClient.deleteReaction. UnitonSendReactionRequest(String cid, Reaction reaction, Boolean enforceUnique, User currentUser)A method called before making an API call to send the reaction. UnitonSendReactionResult(String cid, Reaction reaction, Boolean enforceUnique, User currentUser, Result<Reaction> result)A method called after receiving the response from the send reaction call. Result<Unit>onSendReactionPrecondition(User currentUser, Reaction reaction)Runs precondition check for ChatClient.sendReaction. UnitonGetRepliesRequest(String parentId, Integer limit)Runs side effect before the request is launched. UnitonGetRepliesResult(Result<List<Message>> result, String parentId, Integer limit)Runs this function on the result of the ChatClient.getReplies request. UnitonGetNewerRepliesRequest(String parentId, Integer limit, String lastId)Runs side effect before the request is launched. UnitonGetRepliesMoreRequest(String parentId, String firstId, Integer limit)Runs side effect before the request is launched. UnitonGetRepliesMoreResult(Result<List<Message>> result, String parentId, String firstId, Integer limit)Runs this function on the result of the ChatClient.getRepliesMore request. UnitonGetNewerRepliesResult(Result<List<Message>> result, String parentId, Integer limit, String lastId)Runs this function on the result of the ChatClient.getNewerReplies request. UnitonGiphySendResult(String cid, Result<Message> result)A method called after receiving the response from the send Giphy call. UnitonShuffleGiphyResult(String cid, Result<Message> result)A method called after receiving the response from the shuffle Giphy call. Result<Unit>onMessageDeletePrecondition(String messageId)Runs precondition check for ChatClient.deleteMessage. UnitonMessageDeleteRequest(String messageId)Method called when a request to delete a message in the API happens UnitonMessageDeleteResult(String originalMessageId, Result<Message> result)Method called when a request for message deletion return. UnitonMessageSendResult(Result<Message> result, String channelType, String channelId, Message message)Side effect to be invoked when the original request is completed with a response. UnitonMessageEditRequest(Message message)Method called when a request for message edition happens. UnitonMessageEditResult(Message originalMessage, Result<Message> result)Method called when a request for message edition return. Result<Unit>onQueryChannelPrecondition(String channelType, String channelId, QueryChannelRequest request)Run precondition for the request. UnitonQueryChannelRequest(String channelType, String channelId, QueryChannelRequest request)Runs side effect before the request is launched. UnitonQueryChannelResult(Result<Channel> result, String channelType, String channelId, QueryChannelRequest request)Runs this function on the result of the request. 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. UnitonTypingEventRequest(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. UnitonTypingEventResult(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. Result<Unit>onHideChannelPrecondition(String channelType, String channelId, Boolean clearHistory)Run precondition for the request. UnitonHideChannelRequest(String channelType, String channelId, Boolean clearHistory)Runs side effect before the request is launched. UnitonHideChannelResult(Result<Unit> result, String channelType, String channelId, Boolean clearHistory)Runs this function on the result of the request. UnitonMarkAllReadRequest()Register this side effect to run just before actual ChatClient.markAllRead request is launched. Result<Unit>onChannelMarkReadPrecondition(String channelType, String channelId)Run precondition for the request. UnitonCreateChannelRequest(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. UnitonCreateChannelRequest(String channelType, String channelId, CreateChannelParams params, User currentUser)A method called before making an API call to create a channel. UnitonCreateChannelResult(String channelType, String channelId, List<String> memberIds, Result<Channel> result)A method called after receiving the response from the create channel call. Result<Unit>onCreateChannelPrecondition(User currentUser, String channelId, List<String> memberIds)Runs precondition check for ChatClient.createChannel. UnitonDeleteChannelRequest(User currentUser, String channelType, String channelId)A method called before making an API call to delete a channel. UnitonDeleteChannelResult(String channelType, String channelId, Result<Channel> result)A method called after receiving the response from the delete channel call. Result<Unit>onDeleteChannelPrecondition(User currentUser, String channelType, String channelId)Runs precondition check for ChatClient.deleteChannel. UnitonAttachmentSendRequest(String channelType, String channelId, Message message)Updates the SDK before the attachments are sent to backend. UnitonUserSet(User user)UnitonUserDisconnected()UnitonGetMessageResult(String messageId, Result<Message> result)Method called when the API call requesting a single new message has completed. UnitonFetchCurrentUserResult(Result<User> result)Called when the current user is fetched from the backend. UnitonQueryGroupedChannelsResult(Result<GroupedChannels> result, Integer limit, Map<String, GroupedChannelsGroupQuery> groups, Boolean watch, Boolean presence)Called when the query grouped channels request completes. Result<Unit>onQueryThreadsPrecondition(QueryThreadsRequest request)Run precondition for the request. UnitonQueryThreadsRequest(QueryThreadsRequest request)Runs side effect before the request is launched. UnitonQueryThreadsResult(Result<QueryThreadsResult> result, QueryThreadsRequest request)Runs side effect the request was completed. UnitonBlockUserResult(Result<UserBlock> result)Runs side effect after the request was completed. UnitonUnblockUserResult(String userId, Result<Unit> result)Runs side effect after the request was completed. UnitonQueryBlockedUsersResult(Result<List<UserBlock>> result)Runs side effect after the request was completed. UnitonCreateDraftMessageRequest(String channelType, String channelId, DraftMessage message)Side effect to be invoked before the original request is launched. UnitonCreateDraftMessageResult(Result<DraftMessage> result, String channelType, String channelId, DraftMessage message)Side effect to be invoked when the original request is completed with a response. UnitonDeleteDraftMessagesRequest(String channelType, String channelId, DraftMessage message)Side effect to be invoked before the original request is launched. UnitonDeleteDraftMessagesResult(Result<Unit> result, String channelType, String channelId, DraftMessage message)Side effect to be invoked when the original request is completed with a response. UnitonQueryDraftMessagesResult(Result<List<DraftMessage>> result, Integer offset, Integer limit)Side effect to be invoked when the original request is completed with a response. UnitonQueryDraftMessagesResult(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. Result<Unit>onUpdateLiveLocationPrecondition(Location location)Run precondition for the request. UnitonQueryActiveLocationsResult(Result<List<Location>> result)Called when the result of ChatClient.queryActiveLocations is received. UnitonUpdateLiveLocationResult(Location location, Result<Location> result)Called when the result of ChatClient.updateLiveLocation is received. UnitonStopLiveLocationSharingResult(Location location, Result<Location> result)Called when the result of ChatClient.stopLiveLocationSharing is received. UnitonStartLiveLocationSharingResult(Location location, Result<Location> result)Called when the result of ChatClient.startLiveLocationSharing is received. UnitonChannelPushPreferenceSet(String cid, PushPreferenceLevel level, Result<PushPreference> result)Called when the push notification preference is updated for a given channel. UnitonChannelPushNotificationsSnoozed(String cid, Date until, Result<PushPreference> result)Called when push notifications are snoozed for a given channel until a specified time. -
Methods inherited from class io.getstream.chat.android.client.plugin.Plugin
onDeleteMessageForMePrecondition, onDeleteMessageForMeRequest, onDeleteMessageForMeResult, onGetRepliesPrecondition, onQueryChannelsPrecondition, onQueryChannelsRequest, onQueryChannelsResult, onQueryChannelsResultWithPredefinedFilter, onQueryGroupedChannelsRequest, onSendReactionPrecondition, onSendReactionRequest, resolveDependency -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getErrorHandler
ErrorHandler getErrorHandler()
-
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.
-
onGetRepliesRequest
Unit onGetRepliesRequest(String parentId, Integer limit)
Runs side effect before the request is launched.
-
onGetRepliesResult
Unit onGetRepliesResult(Result<List<Message>> result, String parentId, Integer limit)
Runs this function on the result of the ChatClient.getReplies request.
-
onGetNewerRepliesRequest
Unit onGetNewerRepliesRequest(String parentId, Integer limit, String lastId)
Runs side effect before the request is launched.
-
onGetRepliesMoreRequest
Unit onGetRepliesMoreRequest(String parentId, String firstId, Integer limit)
Runs side effect before the request is launched.
-
onGetRepliesMoreResult
Unit onGetRepliesMoreResult(Result<List<Message>> result, String parentId, String firstId, Integer limit)
Runs this function on the result of the ChatClient.getRepliesMore request.
-
onGetNewerRepliesResult
Unit onGetNewerRepliesResult(Result<List<Message>> result, String parentId, Integer limit, String lastId)
Runs this function on the result of the ChatClient.getNewerReplies request.
-
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.
-
onMessageDeleteRequest
Unit onMessageDeleteRequest(String messageId)
Method called when a request to delete a message in the API happens
-
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.
-
onQueryChannelPrecondition
Result<Unit> onQueryChannelPrecondition(String channelType, String channelId, QueryChannelRequest 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.
-
onQueryChannelRequest
Unit onQueryChannelRequest(String channelType, String channelId, QueryChannelRequest request)
Runs side effect before the request is launched.
- Parameters:
channelType- Type of the requested channel.channelId- Id of the requested channel.request- QueryChannelRequest which is going to be used for the request.
-
onQueryChannelResult
Unit onQueryChannelResult(Result<Channel> result, String channelType, String channelId, QueryChannelRequest request)
Runs this function on the result of the request.
-
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.
-
onMarkAllReadRequest
Unit onMarkAllReadRequest()
Register this side effect to run just before actual ChatClient.markAllRead request is launched.
-
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
@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 datacurrentUser- 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.
-
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.
-
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- StringchannelId- Stringmessage- Message
-
onUserDisconnected
Unit onUserDisconnected()
-
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.
-
onFetchCurrentUserResult
Unit onFetchCurrentUserResult(Result<User> result)
Called when the current user is fetched from the backend.
-
onQueryGroupedChannelsResult
Unit onQueryGroupedChannelsResult(Result<GroupedChannels> result, Integer limit, Map<String, GroupedChannelsGroupQuery> groups, Boolean watch, Boolean presence)
Called when the query grouped channels request completes.
- Parameters:
result- The result of the query grouped channels request.limit- The request-level default per-group limit, ornullfor the server default.groups- The per-group request options that were sent, ornullwhen the request asked for the server-defined default set of groups.watch- Whether watching was requested.presence- Whether presence was requested.
-
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.
-
onQueryThreadsRequest
Unit onQueryThreadsRequest(QueryThreadsRequest request)
Runs side effect before the request is launched.
- Parameters:
request- QueryThreadsRequest which is going to be used for the request.
-
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.
-
onCreateDraftMessageRequest
Unit onCreateDraftMessageRequest(String channelType, String channelId, DraftMessage message)
Side effect to be invoked before the original request is launched.
- Parameters:
channelType- The type of the channel in which message is created.channelId- The id of the channel in which message is created.message- DraftMessage to be created.
-
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 channel in which message is created.message- DraftMessage to be created.
-
onDeleteDraftMessagesRequest
Unit onDeleteDraftMessagesRequest(String channelType, String channelId, DraftMessage message)
Side effect to be invoked before the original request is launched.
- Parameters:
channelType- The type of the channel in which message is deleted.channelId- The id of the channel in which message is deleted.message- DraftMessage to be deleted.
-
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 deleted.channelId- The id of the channel in which message is deleted.message- DraftMessage to be deleted.
-
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.
-
onQueryActiveLocationsResult
Unit onQueryActiveLocationsResult(Result<List<Location>> result)
Called when the result of ChatClient.queryActiveLocations is received.
- Parameters:
result- The result of the query, which is a list of active locations.
-
onUpdateLiveLocationResult
Unit onUpdateLiveLocationResult(Location location, Result<Location> result)
Called when the result of ChatClient.updateLiveLocation is received.
- Parameters:
location- The location used in the request.result- The result of the request.
-
onStopLiveLocationSharingResult
Unit onStopLiveLocationSharingResult(Location location, Result<Location> result)
Called when the result of ChatClient.stopLiveLocationSharing is received.
- Parameters:
location- The location used in request.result- The result of the request.
-
onStartLiveLocationSharingResult
Unit onStartLiveLocationSharingResult(Location location, Result<Location> result)
Called when the result of ChatClient.startLiveLocationSharing is received.
- Parameters:
location- The location used in the request.result- The result of the request.
-
onChannelPushPreferenceSet
Unit onChannelPushPreferenceSet(String cid, PushPreferenceLevel level, Result<PushPreference> result)
Called when the push notification preference is updated for a given channel.
- Parameters:
cid- The full channel ID (e.g., "messaging:123").level- The level at which the preference is set (user, channel, or channel group).result- The result of the update operation, containing the updated PushPreference on success or an error on failure.
-
onChannelPushNotificationsSnoozed
Unit onChannelPushNotificationsSnoozed(String cid, Date until, Result<PushPreference> result)
Called when push notifications are snoozed for a given channel until a specified time.
- Parameters:
cid- The full channel ID (e.g., "messaging:123").until- The Date until which push notifications are snoozed.result- The result of the snooze operation, containing the updated PushPreference on success or an error on failure.
-
-
-
-