Package 

Class DefaultChatEventHandler

  • All Implemented Interfaces:
    io.getstream.chat.android.client.events.ChatEventHandler

    
    public class DefaultChatEventHandler
    extends BaseChatEventHandler
                        

    Default implementation of ChatEventHandler which is based on the current user membership.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      EventHandlingResult handleCidEvent(CidEvent event, FilterObject filter, Channel cachedChannel) Handles additional events:
      • NewMessageEvent - adds the channel to the set if its not a system message.

      • MemberRemovedEvent - removes the channel from the set if a current user left.

      • MemberAddedEvent - adds the channel to the set if a current user was added.

      EventHandlingResult handleChannelEvent(HasChannel event, FilterObject filter) Handles additional events:
      • NotificationMessageNewEvent - calls watch and adds the channel to the set.

      • NotificationRemovedFromChannelEvent - removes the channel from the set if a current user left.

      • NotificationAddedToChannelEvent - calls watch and adds the channel to the set if a current user was added.

      • Methods inherited from class io.getstream.chat.android.offline.event.handler.chat.BaseChatEventHandler

        handleChatEvent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultChatEventHandler

        DefaultChatEventHandler(StateFlow<Map<String, Channel>> channels, ClientState clientState)
        Parameters:
        channels - The map of visible channels.
        clientState - The client state used to obtain current user.
    • Method Detail

      • handleCidEvent

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

        Handles additional events:

        • NewMessageEvent - adds the channel to the set if its not a system message.

        • MemberRemovedEvent - removes the channel from the set if a current user left.

        • MemberAddedEvent - adds the channel to the set if a current user was added.

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

         EventHandlingResult handleChannelEvent(HasChannel event, FilterObject filter)

        Handles additional events:

        • NotificationMessageNewEvent - calls watch and adds the channel to the set.

        • NotificationRemovedFromChannelEvent - removes the channel from the set if a current user left.

        • NotificationAddedToChannelEvent - calls watch and adds the channel to the set if a current user was added.

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