File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,18 @@ def add_moderators(user_ids)
267267 update ( nil , nil , add_moderators : user_ids )
268268 end
269269
270+ # Adds filter tags to the channel.
271+ sig { params ( tags : T ::Array [ String ] ) . returns ( StreamChat ::StreamResponse ) }
272+ def add_filter_tags ( tags )
273+ update ( nil , nil , add_filter_tags : tags )
274+ end
275+
276+ # Removes filter tags from the channel.
277+ sig { params ( tags : T ::Array [ String ] ) . returns ( StreamChat ::StreamResponse ) }
278+ def remove_filter_tags ( tags )
279+ update ( nil , nil , remove_filter_tags : tags )
280+ end
281+
270282 # Removes members from the channel.
271283 sig { params ( user_ids : T ::Array [ String ] ) . returns ( StreamChat ::StreamResponse ) }
272284 def remove_members ( user_ids )
Original file line number Diff line number Diff line change @@ -502,4 +502,20 @@ def loop_times(times)
502502 # Verify it's deleted
503503 expect { @channel . get_draft ( @random_user [ :id ] , parent_id : parent_id ) } . to raise_error ( StreamChat ::StreamAPIException )
504504 end
505+
506+ it 'can add and remove filter tags' do
507+ tags = %w[ urgent bug ]
508+ # Add tags
509+ response = @channel . add_filter_tags ( tags )
510+ expect ( response ) . to include 'channel'
511+
512+ # Ensure tags are set
513+ response = @channel . query
514+ expect ( response [ 'channel' ] [ 'filter_tags' ] ) . to match_array ( tags )
515+
516+ # Remove one tag
517+ @channel . remove_filter_tags ( [ 'urgent' ] )
518+ response = @channel . query
519+ expect ( response [ 'channel' ] [ 'filter_tags' ] ) . to match_array ( [ 'bug' ] )
520+ end
505521end
You can’t perform that action at this time.
0 commit comments