Package 

Class DefaultChatEventHandler

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

    
    public final class DefaultChatEventHandler
    extends BaseChatEventHandler
                        

    Default implementation of ChatEventHandler which covers the default filter of channels. The channel will be added if the current user is a member and it will be removed otherwise.

    • Constructor Detail

      • DefaultChatEventHandler

        DefaultChatEventHandler(StateFlow<List<Channel>> channels)
        Parameters:
        channels - The list of visible channels.
    • Method Detail

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

         EventHandlingResult handleNotificationMessageNewEvent(NotificationMessageNewEvent event, FilterObject filter)

        Handles NotificationMessageNewEvent. It adds the channel, if it is absent.

        Parameters:
        event - Instance of NotificationMessageNewEvent that is being handled.
        filter - FilterObject which is used to define an outcome.
      • 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
      • 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.