@@ -58,6 +58,13 @@ final class DemoChatChannelListVC: ChatChannelListVC {
58
58
] )
59
59
] )
60
60
)
61
+
62
+ lazy var channelModeratorChannelsQuery : ChannelListQuery = . init(
63
+ filter: . and( [
64
+ . containMembers( userIds: [ currentUserId] ) ,
65
+ . equal( . channelRole, to: " channel_moderator " )
66
+ ] )
67
+ )
61
68
62
69
lazy var unreadCountChannelsQuery : ChannelListQuery = . init(
63
70
filter: . and( [
@@ -180,6 +187,15 @@ final class DemoChatChannelListVC: ChatChannelListVC {
180
187
self ? . setBlockedUnblockedWithHiddenChannelsQuery ( )
181
188
}
182
189
)
190
+
191
+ let channelRoleChannelsAction = UIAlertAction (
192
+ title: " Moderator Channels " ,
193
+ style: . default,
194
+ handler: { [ weak self] _ in
195
+ self ? . title = " Moderator Channels "
196
+ self ? . setChannelModeratorChannelsQuery ( )
197
+ }
198
+ )
183
199
184
200
let unreadCountChannelsAction = UIAlertAction (
185
201
title: " Unread Count Channels " ,
@@ -254,7 +270,8 @@ final class DemoChatChannelListVC: ChatChannelListVC {
254
270
coolChannelsAction,
255
271
pinnedChannelsAction,
256
272
archivedChannelsAction,
257
- equalMembersAction
273
+ equalMembersAction,
274
+ channelRoleChannelsAction
258
275
] . sorted ( by: { $0. title ?? " " < $1. title ?? " " } ) ,
259
276
preferredStyle: . actionSheet,
260
277
sourceView: filterChannelsButton
@@ -272,6 +289,10 @@ final class DemoChatChannelListVC: ChatChannelListVC {
272
289
func setBlockedUnblockedWithHiddenChannelsQuery( ) {
273
290
replaceQuery ( blockedUnblockedWithHiddenChannelsQuery)
274
291
}
292
+
293
+ func setChannelModeratorChannelsQuery( ) {
294
+ replaceQuery ( channelModeratorChannelsQuery)
295
+ }
275
296
276
297
func setUnreadCountChannelsQuery( ) {
277
298
replaceQuery ( unreadCountChannelsQuery)
0 commit comments