Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter All Chats Except Requests Chats #4872

Closed
muaviyaijaz123 opened this issue Jul 12, 2023 · 2 comments
Closed

Filter All Chats Except Requests Chats #4872

muaviyaijaz123 opened this issue Jul 12, 2023 · 2 comments
Labels
bug Something isn't working waiting for response Further information is requested

Comments

@muaviyaijaz123
Copy link

Describe the bug

Hi,

I have a scenario where we want to filter all chats except those ones in which user is invited. For this we use the following filter block in ChannelListViewModelFactory:

  ChannelListViewModelFactory(filter = Filters.and(Filters.eq("type", "messaging"),
                                                                   Filters.`in`("members", listOf(userId)),
                                                                   Filters.eq("joined",true)))

It works fine initially BUT when a message comes in a chat in which user was invited, that chat also gets shown in that list. We want to eliminate that.We also looked at CustomEventHandler to handle channel updates but couldn't find a way to make the requested chat go away from all chats list when a message comes in that chat.

I also raised a similar issue for filtering requests chats and handling updates in:

#4782

but here i require the exact opposite, meaning I only want those chats which are not invitations and also want to handle updates on any receiving events for such chats

SDK version

  • 5.17.3

Expected behavior
All Chats except invited ones should be visible and on any events received, requests chats shouldn't show up in these chats

Device:

  • Vendor and model: Samsung A30
  • Android version: 11
@muaviyaijaz123 muaviyaijaz123 added the bug Something isn't working label Jul 12, 2023
@kanat
Copy link
Collaborator

kanat commented Sep 25, 2024

Hi @muaviyaijaz123,

You van provide custom ChatEventHandler and just ignore the event by returning EventHandlingResult.Skip.

However, you need to think of the data on which you base the decision of whether or not to return EventHandlingResult.Skip. For instance, you could check Channel.membership, and if it’s null, skip the event.

@kanat kanat added the waiting for response Further information is requested label Sep 25, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

This issue has been automatically closed because there has been no response to our request from the original author. Please don't hesitate to comment on the bug if you have any more information for us - we will reopen it right away! Thanks for your contribution.

@github-actions github-actions bot closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for response Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants