-
- 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 Summary
Constructors Constructor Description DefaultChatEventHandler(StateFlow<List<Channel>> channels)
-
Method Summary
Modifier and Type Method Description EventHandlingResulthandleNotificationAddedToChannelEvent(NotificationAddedToChannelEvent event, FilterObject filter)Handles NotificationAddedToChannelEvent event. EventHandlingResulthandleMemberAddedEvent(MemberAddedEvent event, FilterObject filter, Channel cachedChannel)Handles MemberAddedEvent event. EventHandlingResulthandleChannelUpdatedByUserEvent(ChannelUpdatedByUserEvent event, FilterObject filter)Handles ChannelUpdatedByUserEvent event. EventHandlingResulthandleChannelUpdatedEvent(ChannelUpdatedEvent event, FilterObject filter)Handles ChannelUpdatedEvent event. EventHandlingResulthandleNotificationMessageNewEvent(NotificationMessageNewEvent event, FilterObject filter)Handles NotificationMessageNewEvent. EventHandlingResulthandleMemberRemovedEvent(MemberRemovedEvent event, FilterObject filter, Channel cachedChannel)Handles MemberRemovedEvent. EventHandlingResulthandleNotificationRemovedFromChannelEvent(NotificationRemovedFromChannelEvent event, FilterObject filter)Handles NotificationRemovedFromChannelEvent. -
-
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.
-
handleChannelUpdatedByUserEvent
EventHandlingResult handleChannelUpdatedByUserEvent(ChannelUpdatedByUserEvent event, FilterObject filter)
Handles ChannelUpdatedByUserEvent event. The event is skipped.
-
handleChannelUpdatedEvent
EventHandlingResult handleChannelUpdatedEvent(ChannelUpdatedEvent event, FilterObject filter)
Handles ChannelUpdatedEvent event. The event is skipped.
-
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.
-
-
-
-