Package 

Class BaseChatEventHandler

  • All Implemented Interfaces:
    io.getstream.chat.android.offline.event.handler.chat.ChatEventHandler

    
    public abstract class BaseChatEventHandler
     implements ChatEventHandler
                        

    More specific ChatEventHandler implementation that gives you a separation between CidEvent and HasChannel events.

    The channel will be removed from the set after receiving ChannelDeletedEvent, NotificationChannelDeletedEvent, ChannelHiddenEvent events.

    The channel will be watched and added to the set after receiving ChannelVisibleEvent event.

    Other events will be skipped.

    • Constructor Detail

      • BaseChatEventHandler

        BaseChatEventHandler()
    • Method Detail

      • handleChannelEvent

         EventHandlingResult handleChannelEvent(HasChannel event, FilterObject filter)

        Handles HasChannel event which contains specific Channel object.

        Parameters:
        event - ChatEvent that may contain updates for the set of channels.
        filter - FilterObject associated with the set of channels.
      • handleCidEvent

         EventHandlingResult handleCidEvent(CidEvent event, FilterObject filter, Channel cachedChannel)

        Handles CidEvent event which is associated with a specific Channel which can be tracked using CidEvent.cid.

        Parameters:
        event - ChatEvent that may contain updates for the set of channels.
        filter - FilterObject associated with the set of channels.
        cachedChannel - optional cached Channel object if exists.
      • handleChatEvent

         EventHandlingResult handleChatEvent(ChatEvent event, FilterObject filter, Channel cachedChannel)

        Computes the event handling result.

        Parameters:
        event - ChatEvent that may contain updates for the set of channels.
        filter - FilterObject associated with the set of channels.
        cachedChannel - optional cached Channel object.