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.
Moderation Configuration
We have a dedicated documentation for Moderation now. Please refer to dedicated Chat Moderation guide for details.
Moderated Messages
You can check if a message was moderated by checking the moderationDetails property of ChatMessage. It is nil for regular messages. For moderated messages, it contains:
originalText- the original text of the message.action- the moderation action that was applied, for example.bounceor.remove.textHarms,imageHarms,blocklistsMatched,semanticFilterMatchedandplatformCircumvented- the reasons the message was moderated.
A bounced message is a message that was rejected by the moderation policy and was not delivered to the other channel members. Only its author can see it, and they can decide to send it anyway, edit it or delete it. You can check if a message was bounced with the isBounced property:
if message.isBounced {
print("Bounced: \(message.moderationDetails?.originalText ?? message.text)")
}Flagging a message sends it to the moderation queue of your app, where a moderator can review it. By default, users can flag messages sent by other users, as long as the channel grants them the flag capability (channel.canFlagMessage).
Customizing the UI
The UIKit and SwiftUI components handle bounced and flagged messages out of the box. To change how they look and behave, see: