Skip to content

Commit 1b67323

Browse files
[CHA-1702] Add Future Channel Bans support (#192)
* feat: [CHA-1699] add Future Channel Bans support - Add query_future_channel_bans method - ban_user/unban_user already support options for new parameters * feat: [CHA-1702] Add options parameter to channel.unban_user for FCB support Allow passing remove_future_channels_ban option to the channel unban method. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 92c9856 commit 1b67323

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

lib/stream-chat/channel.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ def ban_user(user_id, **options)
323323
end
324324

325325
# Removes the ban for a user on this channel.
326-
sig { params(user_id: String).returns(StreamChat::StreamResponse) }
327-
def unban_user(user_id)
328-
@client.unban_user(user_id, type: @channel_type, id: @id)
326+
sig { params(user_id: String, options: T.untyped).returns(StreamChat::StreamResponse) }
327+
def unban_user(user_id, **options)
328+
@client.unban_user(user_id, type: @channel_type, id: @id, **options)
329329
end
330330

331331
# Removes a channel from query channel requests for that user until a new message is added.

lib/stream-chat/client.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,15 @@ def query_banned_users(filter_conditions, sort: nil, **options)
485485
get('query_banned_users', params: { payload: params.to_json })
486486
end
487487

488+
# Queries future channel bans.
489+
#
490+
# Future channel bans are automatically applied when a user creates a new channel
491+
# or adds a member to an existing channel.
492+
sig { params(options: T.untyped).returns(StreamChat::StreamResponse) }
493+
def query_future_channel_bans(**options)
494+
get('query_future_channel_bans', params: { payload: options.to_json })
495+
end
496+
488497
# Allows you to search for users and see if they are online/offline.
489498
# You can filter and sort on the custom fields you've set for your user, the user id, and when the user was last active.
490499
sig { params(filter_conditions: StringKeyHash, sort: T.nilable(T::Hash[String, Integer]), options: T.untyped).returns(StreamChat::StreamResponse) }

0 commit comments

Comments
 (0)