Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add moderation guide #2447

Merged
merged 7 commits into from
Feb 29, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions docusaurus/docs/reactnative/guides/moderation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
id: moderation
title: Moderation
---

Stream Chat has support for several moderation actions, such as flagging, muting, banning and shadow banning. You can find more details about the available low-level client moderation tools on this [page](https://getstream.io/chat/docs/ios-swift/moderation/?language=swift).

You can moderate flagged messages and users through Stream's [moderation dashboard](https://getstream.io/chat/docs/javascript/moderation/?language=javascript).

### Moderation Categories

For each channel type, you can enable AI moderation, consisting of 4 moderation categories:

- Semantic Filters
- Commercial Spam
- Platform Circumvention
- Blocklists

![Dashboard moderation categories](../assets/guides/moderation/moderation-dashboard.png)

For each moderation category, you can configure an action that will be performed after a message falls into that category.

The available actions are:

- Flag
- Block
- Bounce
- Bounce then flag
- Bounce then block

### React Native SDK Handling

In the React Native SDK, you can check if a message was moderated, by checking the `moderation_details` value in the chat message, which is not defined or `undefined` for regular messages.

If a message is blocked by moderation, the message `type` is `error` and the message text contains `Message was blocked by moderation policies`.

If a message is bounced by moderation, the message `type` is `error` and the message `moderation_details` value is defined.

### UI Components handling

The React Native SDK handles the bounced messages by default. When a message is bounced, there is a visual indicator on the message view to reflect that.

![Bounced message](../assets/guides/moderation/bounced-message.png)

When you press/long press on a message, you can perform several default actions on it, such as editing and deleting it, as well as trying to resent it.

![Bounced message actions](../assets/guides/moderation/bounced-message-action.png)

:::note
When you try to resend a message when bounced, if the bounced then flag settings is applied, the message will be marked as flag after being sent the second time.

When you try to resend a message when bounced, if the bounced then blocked settings is applied, the message will be blocked after being sent the second time.
:::

You can customize the default actions on the bounced message action handler component, that is, [MessageBounce](../ui-components/message-bounce.mdx) component by passing it to the [`Channel`](../core-components/channel.mdx#messagebounce) component.
1 change: 1 addition & 0 deletions docusaurus/sidebars-react-native.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"customization/native_handlers",
"basics/translations",
"guides/keyboard",
"guides/moderation",
"guides/going-live-checklist",
{
"Push Notifications": ["guides/push-notifications-v1", "guides/push-notifications-v2"]
Expand Down
Loading