How can i use channelhandler in UIkit . i want to filter channel List on event base like if someone send me message than before message receive i use event and hide the channel using custom type can i do this in component. ?
Have any idea or sample code for UIKit?
This is a pretty specific use-case that I don’t believe is currently possible with the UiKit. You can get the sdk instance using the state or selectors and could add a channel handler or something but it sounds like your channel list component itself would need to support that custom logic.
I haven’t tried this and I think I would recommend avoiding doing this in the UiKit entirely, but I suppose on idea that might work would be to provide a custom renderChannelPreview component to the channel list and have that check against a list of channels you want to hide. If the channel is in the hidden list you could just render something invisible. In this scenario you would be storing the list of hidden channels client side based on the events you receive.
Could you explain what you’re trying to do here exactly?
At that point it may be better to just use the core SDK and build a custom chat app.
Also can you just use a different channel list query, or is it specifically to hide a channel based on the content of a message? If so, what if you did this using webhooks and hide a channel for the user based on the content.
If it is related to this issue I may have misunderstood. Could you just clarify a bit about the issue you are having? Is it simply which channels show up in the channel list filtered by the channel’s custom type, or are you wanting to hide the channel based on some property of the message?
Thanks @alex.orr for quick and detailed answer,
Yes we are try to check the incoming messages and channel based on custom_types. And we did that via onMessageRecieved event handler.
The requirement is that as we switched to different module within our application, we need only those users and channels which are have the custom_types match with that module. we used GUID to distinct each module of our application.
What so far we have achieved is that able to filter/control the channels, users and messages.
- Users via metadata.
- Channels and messages via custom_types