-
What did you do?I muted a user What did you expect to happen?I expected not to see new messages from that user What happened instead?I still see messages from that user GetStream EnvironmentGetStream Chat version: 4.0.1 Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@srgray the SDK does not make any assumption on how apps deal with muted users. We'll add a an example snippet just show how hiding muted messages can be done. |
Beta Was this translation helpful? Give feedback.
-
Hello @srgray , I'm pasting my answer to #2061 here, since it's basically the same question: When you implement your own UI, you'll have to filter on 2 places: ChannelController.messages -> you'll most probably use this for numberOfItemsInSection, you have to filter out the messages you won't display. This "filtering" logic can create a bottleneck as the number of messages grows Keep in mind that if you go through the predicate route, you won't see performance issues but you won't be able to filter based on extraData since ExtraData is kept as Data in DB, you can't create predicates for them. |
Beta Was this translation helpful? Give feedback.
Hello @srgray ,
I'm pasting my answer to #2061 here, since it's basically the same question:
"""
It's possible although it's tricky.
When you implement your own UI, you'll have to filter on 2 places:
ChannelController.messages -> you'll most probably use this for numberOfItemsInSection, you have to filter out the messages you won't display. This "filtering" logic can create a bottleneck as the number of messages grows
ChannelControllerDelegate.didUpdateMessages delegate callback -> you need to discard updates related to messages you're not displaying
Alternatively, you can fork the SDK and introduce a var messagesPredicate in ChatChannelController, which you can pass to messagesObserver i…