Legacy Notice: This extension is considered legacy and is scheduled for deprecation in the near future. It is no longer recommended for new integrations.Please note: Legacy extensions are no longer actively maintained and will not receive feature updates or enhancements.
Extension settings
- Login to the CometChat and select your app.
- Go to the Extensions section and enable the Profanity Filter extension.
- Open Settings and choose to Drop messages with Profanity.
- Also, you can provide the comma separated list of words that you would like to filter.
Support for filtering emojis
Apart from words, we have also added support for filtering Profane emojis along with words. The only thing that you need to keep in mind is, certain emojis have skin tones or other variations associated with them. As part of the comma separated values, all the variations need to be covered. For eg: In case of finger pointing left, you need to add: 👈🏿,👈🏾,👈🏽,👈🏼,👈🏻,👈. Please note that the yellow variant has to be entered at the end of the list. Refer https://emojipedia.org/ for details.How does it work?
The recipients will receive the normal message in the text field of the message object. Also, there will be a clean/filtered version of the message in the metadata section as shown below:- JSON
Implementation
By checking ifprofanity
is set to yes
, you can also consider showing a warning before reading the message.
From the extension settings, you can also choose to drop the message altogether.
At the recipients’ end, from the message
object, you can fetch the metadata by calling the getMetadata()
method. Using this metadata, you can fetch the masked message.
- JavaScript
- Java
- Kotlin
- Swift