Closed ezgiozkan closed 1 year ago
Hi @ezgiozkan,
Are you probably having 2 channel lists active at the same time? Please check the documentation and use the filter block: https://getstream.io/chat/docs/sdk/ios/client/controllers/channels/#2-create-a-controller
Closing the issue for now, let us know if you still have problems when introducing the filter blocks.
Best, Nuno
I am using filtering as in the document. However, channels with .team type are displayed in the list as the message is received. The filtering process does not work correctly. I am rewriting the code I used for you to review.
let query = ChannelListQuery(filter: .and([.containMembers(userIds: [userId]), .nonEmpty, .notEqual(.type, to: .team)]))
As an extra note, the same filtering method works correctly for channels whose type is .livestream. But it doesn't work properly for channels with team type.
@ezgiozkan
The filter you are missing is in the channelController
.
let controller = ChatClient.shared.channelListController(query: query, filter: { channel in
// the filtering logic goes here.
return !channel.messages.isEmpty && channel.lastActiveMembers.contains(userId) && channel.type != "team"
})
Something like that.
Best, Nuno
Messages with the type "team" in ChatChannelListVC should not be listed. However, messages of this type continue to arrive, or messages with the type "messaging" do not appear, and the list returns empty.
GetStream Environment
GetStream Chat version: 4.20.0 GetStream Chat frameworks: StreamChat, StreamChatUI Xcode version: 13.4.1