Package 

Class DefaultChatEventHandler

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

      EventHandlingResult handleMemberRemovedEvent(MemberRemovedEvent event, FilterObject filter, Channel cachedChannel) Handles MemberRemovedEvent.
      EventHandlingResult handleMemberAddedEvent(MemberAddedEvent event, FilterObject filter, Channel cachedChannel) Handles MemberAddedEvent event.
      EventHandlingResult handleNotificationRemovedFromChannelEvent(NotificationRemovedFromChannelEvent event, FilterObject filter) Handles NotificationRemovedFromChannelEvent.
      EventHandlingResult handleNotificationAddedToChannelEvent(NotificationAddedToChannelEvent event, FilterObject filter) Handles NotificationAddedToChannelEvent event.
      EventHandlingResult handleChannelUpdatedByUserEvent(ChannelUpdatedByUserEvent event, FilterObject filter) Handles ChannelUpdatedByUserEvent event.
      EventHandlingResult handleChannelUpdatedEvent(ChannelUpdatedEvent event, FilterObject filter) Handles ChannelUpdatedEvent event.
      • Methods inherited from class io.getstream.chat.android.offline.event.handler.chat.BaseChatEventHandler

        handleChannelVisibleEvent, handleChatEvent, handleNotificationMessageNewEvent
      • 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.
      • handleMemberRemovedEvent

         EventHandlingResult handleMemberRemovedEvent(MemberRemovedEvent event, FilterObject filter, Channel cachedChannel)

        Handles MemberRemovedEvent. It removes the channel if it's present in the list.

        Parameters:
        event - Instance of MemberRemovedEvent that is being handled.
        filter - FilterObject which is used to define an outcome.
        cachedChannel - optional Channel object cached in database
      • handleMemberAddedEvent

         EventHandlingResult handleMemberAddedEvent(MemberAddedEvent event, FilterObject filter, Channel cachedChannel)

        Handles MemberAddedEvent event. It adds the channel if it is absent.

        Parameters:
        event - Instance of NotificationAddedToChannelEvent that is being handled.
        filter - FilterObject which is used to define an outcome.
        cachedChannel - optional Channel object cached in database.
      • handleNotificationRemovedFromChannelEvent

         EventHandlingResult handleNotificationRemovedFromChannelEvent(NotificationRemovedFromChannelEvent event, FilterObject filter)

        Handles NotificationRemovedFromChannelEvent. It removes the channel if it's present in the list.

        Parameters:
        event - Instance of NotificationRemovedFromChannelEvent that is being handled.
        filter - FilterObject which is used to define an outcome.
      • handleNotificationAddedToChannelEvent

         EventHandlingResult handleNotificationAddedToChannelEvent(NotificationAddedToChannelEvent event, FilterObject filter)

        Handles NotificationAddedToChannelEvent event. It adds the channel if it is absent.

        Parameters:
        event - Instance of NotificationAddedToChannelEvent that is being handled.
        filter - FilterObject which is used to define an outcome.