Package 

Class NonMemberChatEventHandler

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

    @Deprecated(message = "This class has been deprecated and will be removed.You can either use BaseChatEventHandler or DefaultChatEventHandler for custom implementation.", level = DeprecationLevel.WARNING) 
    public final class NonMemberChatEventHandler
    extends BaseChatEventHandler
                        

    Implementation of ChatEventHandler that adds the channel if the current user is not a member and it will removed it otherwise.

    • Constructor Detail

      • NonMemberChatEventHandler

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

      • handleNotificationAddedToChannelEvent

         EventHandlingResult handleNotificationAddedToChannelEvent(NotificationAddedToChannelEvent event, FilterObject filter)

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

        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 removes the channel if it's present in the list

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

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

        Handles MemberRemovedEvent. It adds the channel if it is absent.

        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 adds the channel if it is absent.

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