-
- All Implemented Interfaces:
-
io.getstream.chat.android.client.experimental.plugin.Plugin,io.getstream.chat.android.client.experimental.plugin.listeners.ChannelMarkReadListener,io.getstream.chat.android.client.experimental.plugin.listeners.EditMessageListener,io.getstream.chat.android.client.experimental.plugin.listeners.GetMessageListener,io.getstream.chat.android.client.experimental.plugin.listeners.HideChannelListener,io.getstream.chat.android.client.experimental.plugin.listeners.MarkAllReadListener,io.getstream.chat.android.client.experimental.plugin.listeners.QueryChannelListener,io.getstream.chat.android.client.experimental.plugin.listeners.QueryChannelsListener,io.getstream.chat.android.client.experimental.plugin.listeners.ThreadQueryListener
public final class OfflinePlugin implements Plugin, QueryChannelsListener, QueryChannelListener, ThreadQueryListener, ChannelMarkReadListener, EditMessageListener, GetMessageListener, HideChannelListener, MarkAllReadListenerImplementation of Plugin that brings support for the offline feature. The entry point of all offline state (OfflinePlugin.state) and behavior (OfflinePlugin.logic).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classOfflinePlugin.Companion
-
Field Summary
Fields Modifier and Type Field Description private StateRegistrystateprivate final GlobalStateglobalStateprivate final Stringname
-
Constructor Summary
Constructors Constructor Description OfflinePlugin(Config config)
-
Method Summary
Modifier and Type Method Description final StateRegistrygetState()StateRegistry which contains all states of this plugin. final UnitsetState(StateRegistry state)final GlobalStategetGlobalState()Global state of this plugin. StringgetName()Unitinit(Context appContext, ChatClient chatClient)UnitonMessageEditRequest(Message message)Method called when a message edit request happens. UnitonMessageEditResult(Message originalMessage, Result<Message> result)Method called when an edition in a message returns from the API. UnitonQueryChannelsRequest(QueryChannelsRequest request)UnitonQueryChannelsResult(Result<List<Channel>> result, QueryChannelsRequest request)Result<Unit>onQueryChannelPrecondition(String channelType, String channelId, QueryChannelRequest request)UnitonQueryChannelRequest(String channelType, String channelId, QueryChannelRequest request)UnitonQueryChannelResult(Result<Channel> result, String channelType, String channelId, QueryChannelRequest request)Result<Unit>onGetRepliesPrecondition(String messageId, Integer limit)UnitonGetRepliesRequest(String messageId, Integer limit)UnitonGetRepliesResult(Result<List<Message>> result, String messageId, Integer limit)Result<Unit>onGetRepliesMorePrecondition(String messageId, String firstId, Integer limit)UnitonGetRepliesMoreRequest(String messageId, String firstId, Integer limit)UnitonGetRepliesMoreResult(Result<List<Message>> result, String messageId, String firstId, Integer limit)Result<Unit>onChannelMarkReadPrecondition(String channelType, String channelId)UnitonMarkAllReadRequest()UnitonGetMessageResult(Result<Message> result, String cid, String messageId, Integer olderMessagesOffset, Integer newerMessagesOffset)Result<Message>onGetMessageError(String cid, String messageId, Integer olderMessagesOffset, Integer newerMessagesOffset)Result<Unit>onHideChannelPrecondition(String channelType, String channelId, Boolean clearHistory)UnitonHideChannelRequest(String channelType, String channelId, Boolean clearHistory)UnitonHideChannelResult(Result<Unit> result, String channelType, String channelId, Boolean clearHistory)-
-
Constructor Detail
-
OfflinePlugin
OfflinePlugin(Config config)
- Parameters:
config- Configuration options for this plugin.
-
-
Method Detail
-
getState
final StateRegistry getState()
StateRegistry which contains all states of this plugin.
-
setState
final Unit setState(StateRegistry state)
-
getGlobalState
final GlobalState getGlobalState()
Global state of this plugin.
-
onMessageEditRequest
Unit onMessageEditRequest(Message message)
Method called when a message edit request happens. This method should be used to update messages locally and update the cache.
- Parameters:
message- Message.
-
onMessageEditResult
Unit onMessageEditResult(Message originalMessage, Result<Message> result)
Method called when an edition in a message returns from the API.
- Parameters:
result- the result of the API call.
-
onQueryChannelsRequest
Unit onQueryChannelsRequest(QueryChannelsRequest request)
-
onQueryChannelsResult
Unit onQueryChannelsResult(Result<List<Channel>> result, QueryChannelsRequest request)
-
onQueryChannelPrecondition
Result<Unit> onQueryChannelPrecondition(String channelType, String channelId, QueryChannelRequest request)
-
onQueryChannelRequest
Unit onQueryChannelRequest(String channelType, String channelId, QueryChannelRequest request)
-
onQueryChannelResult
Unit onQueryChannelResult(Result<Channel> result, String channelType, String channelId, QueryChannelRequest request)
-
onGetRepliesPrecondition
Result<Unit> onGetRepliesPrecondition(String messageId, Integer limit)
-
onGetRepliesRequest
Unit onGetRepliesRequest(String messageId, Integer limit)
-
onGetRepliesResult
Unit onGetRepliesResult(Result<List<Message>> result, String messageId, Integer limit)
-
onGetRepliesMorePrecondition
Result<Unit> onGetRepliesMorePrecondition(String messageId, String firstId, Integer limit)
-
onGetRepliesMoreRequest
Unit onGetRepliesMoreRequest(String messageId, String firstId, Integer limit)
-
onGetRepliesMoreResult
Unit onGetRepliesMoreResult(Result<List<Message>> result, String messageId, String firstId, Integer limit)
-
onChannelMarkReadPrecondition
Result<Unit> onChannelMarkReadPrecondition(String channelType, String channelId)
-
onMarkAllReadRequest
Unit onMarkAllReadRequest()
-
onGetMessageResult
Unit onGetMessageResult(Result<Message> result, String cid, String messageId, Integer olderMessagesOffset, Integer newerMessagesOffset)
-
onGetMessageError
Result<Message> onGetMessageError(String cid, String messageId, Integer olderMessagesOffset, Integer newerMessagesOffset)
-
onHideChannelPrecondition
Result<Unit> onHideChannelPrecondition(String channelType, String channelId, Boolean clearHistory)
-
onHideChannelRequest
Unit onHideChannelRequest(String channelType, String channelId, Boolean clearHistory)
-
-
-
-