-
- 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.
-
-
Constructor Summary
Constructors Constructor Description DefaultChatEventHandler(StateFlow<Map<String, Channel>> channels, ClientState clientState)
-
Method Summary
Modifier and Type Method Description EventHandlingResulthandleCidEvent(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.
EventHandlingResulthandleChannelEvent(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.
-
-
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.
-
-
-