Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ jobs:
lint: true
- ruby: "3.4"
lint: true
name: 💎 Ruby ${{ matrix.ruby }}
# Exercise jwt v3 alongside the default v2 resolution.
- ruby: "4.0"
jwt: "~> 3.0"
name: 💎 Ruby ${{ matrix.ruby }}${{ matrix.jwt && format(' (jwt {0})', matrix.jwt) || '' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # gives the commit linter access to previous commits

- name: Pin jwt to ${{ matrix.jwt }}
if: matrix.jwt
run: echo "gem 'jwt', '${{ matrix.jwt }}'" >> Gemfile

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
4 changes: 2 additions & 2 deletions docs/best_practices/moderation.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ client.update_channel_type(

### Blocklist

A Blocklist is a list of words that you can use to moderate chat messages. Stream Chat comes with a built-in Blocklist called `profanity_en_2020_v1` which contains over a thousand of the most common profane words.
A Blocklist is a list of words that you can use to moderate chat messages. Stream Chat comes with a built-in Blocklist called `profanity` which contains over a thousand of the most common profane words.

You can manage your own blocklists via the Stream dashboard or APIs to a manage blocklists and configure your channel types to use them. Channel types can be configured to block or flag messages from your users based on your blocklists. To do this you need to configure your channel type(s) with these two configurations: `blocklist` and `blocklist_behavior` . The first one refers to the name of the blocklist and the second must be set as `block` or `flag` .

Expand Down Expand Up @@ -145,7 +145,7 @@ client.update_channel_type("messaging", blocklist: "no-cakes", blocklist_behavio

#### List available blocklists

All applications have the `profanity_en_2020_v1` blocklist available. This endpoint returns all blocklists available for this application.
All applications have the `profanity` blocklist available. This endpoint returns all blocklists available for this application.

```ruby
client.list_blocklists()
Expand Down
4 changes: 2 additions & 2 deletions docs/webhooks/webhook_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ When applicable, the following attributes are included to the event user and to
"blocklist_behavior": "flag",
"blocklists": [
{
"blocklist": "profanity_en_2020_v1",
"blocklist": "profanity",
"behavior": "block"
}
],
Expand Down Expand Up @@ -877,7 +877,7 @@ When applicable, the following attributes are included to the event user and to
"max_message_length": 5000,
"automod": "disabled",
"automod_behavior": "flag",
"blocklist": "profanity_en_2020_v1",
"blocklist": "profanity",
"blocklist_behavior": "block",
"automod_thresholds": {},
"commands": [
Expand Down
12 changes: 6 additions & 6 deletions lib/stream-chat/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
require 'stream-chat/channel_batch_updater'

module StreamChat
DEFAULT_BLOCKLIST = 'profanity_en_2020_v1'
DEFAULT_BLOCKLIST = 'profanity'
SOFT_DELETE = 'soft'
HARD_DELETE = 'hard'

Expand Down Expand Up @@ -739,7 +739,7 @@ def create_guest(user)
# Returns all blocklists.
#
# A Block List is a list of words that you can use to moderate chat messages. Stream Chat
# comes with a built-in Block List called profanity_en_2020_v1 which contains over a thousand
# comes with a built-in Block List called profanity which contains over a thousand
# of the most common profane words.
# You can manage your own block lists via the Stream dashboard or APIs to a manage
# blocklists and configure your channel types to use them.
Expand All @@ -751,7 +751,7 @@ def list_blocklists
# Returns a blocklist.
#
# A Block List is a list of words that you can use to moderate chat messages. Stream Chat
# comes with a built-in Block List called profanity_en_2020_v1 which contains over a thousand
# comes with a built-in Block List called profanity which contains over a thousand
# of the most common profane words.
# You can manage your own block lists via the Stream dashboard or APIs to a manage
# blocklists and configure your channel types to use them.
Expand All @@ -763,7 +763,7 @@ def get_blocklist(name)
# Creates a blocklist.
#
# A Block List is a list of words that you can use to moderate chat messages. Stream Chat
# comes with a built-in Block List called profanity_en_2020_v1 which contains over a thousand
# comes with a built-in Block List called profanity which contains over a thousand
# of the most common profane words.
# You can manage your own block lists via the Stream dashboard or APIs to a manage
# blocklists and configure your channel types to use them.
Expand All @@ -775,7 +775,7 @@ def create_blocklist(name, words)
# Updates a blocklist.
#
# A Block List is a list of words that you can use to moderate chat messages. Stream Chat
# comes with a built-in Block List called profanity_en_2020_v1 which contains over a thousand
# comes with a built-in Block List called profanity which contains over a thousand
# of the most common profane words.
# You can manage your own block lists via the Stream dashboard or APIs to a manage
# blocklists and configure your channel types to use them.
Expand All @@ -787,7 +787,7 @@ def update_blocklist(name, words)
# Deletes a blocklist.
#
# A Block List is a list of words that you can use to moderate chat messages. Stream Chat
# comes with a built-in Block List called profanity_en_2020_v1 which contains over a thousand
# comes with a built-in Block List called profanity which contains over a thousand
# of the most common profane words.
# You can manage your own block lists via the Stream dashboard or APIs to a manage
# blocklists and configure your channel types to use them.
Expand Down
2 changes: 0 additions & 2 deletions sorbet/rbi/hidden-definitions/hidden.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -8698,8 +8698,6 @@ end

class StringScanner
def bol?(); end

def initialize(*arg); end
Id = ::T.let(nil, ::T.untyped)
Version = ::T.let(nil, ::T.untyped)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def loop_times(times)

it 'creates a user token' do
token = @client.create_token('tommaso')
payload = JWT.decode(token, @client.api_secret)
payload = JWT.decode(token, @client.api_secret, true, { algorithm: 'HS256' })
expect(payload[0].fetch('user_id')).to eq 'tommaso'
end

Expand Down
2 changes: 1 addition & 1 deletion spec/moderation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def loop_times(times)
enabled: true,
rules: [
{
name: 'profanity_en_2020_v1',
name: StreamChat::DEFAULT_BLOCKLIST,
action: 'flag'
}
]
Expand Down
2 changes: 1 addition & 1 deletion stream-chat.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'faraday', '~> 2.12'
gem.add_dependency 'faraday-multipart', '~> 1.1'
gem.add_dependency 'faraday-net_http_persistent', '~> 2.3'
gem.add_dependency 'jwt', '~> 2.10'
gem.add_dependency 'jwt', '>= 2.10', '< 4'
gem.add_dependency 'net-http-persistent', '~> 4.0'
gem.add_dependency 'sorbet-runtime', '>= 0.5.11820', '< 1'
end
Loading