RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.46k stars 10.54k forks source link

Badwords Filtering not working on new Message Parser #27298

Closed dudanogueira closed 1 year ago

dudanogueira commented 1 year ago

Description:

When you set up bad words to be filtered, it will change for *** on notifications, but not on channel.

Steps to reproduce:

  1. Enable WORKSPACE > SETTINGS > MESSAGE > Allow Message bad words filtering
  2. WORKSPACE > SETTINGS > MESSAGE > Add Bad Words to the Blacklist to onebadword,otherbadword
  3. Send a message to a channel: onebadword followed by otherbadword

Expected behavior (this is what happens if using legacy message parser):

image

Actual behavior:

image

Server Setup Information:

Client Setup Information

Additional context

Relevant logs:

dudanogueira commented 1 year ago

For reference: https://forums.rocket.chat/t/cant-add-bad-words-to-blacklist/15363/3

henit-chobisa commented 1 year ago

Hello @dudanogueira, hope you're doing well! 😄 I am passionate to work on this issue, if you can tell me, how should I go about the new fuselage message-parser, I would be more than grateful to you.

dudanogueira commented 1 year ago

Hello @dudanogueira, hope you're doing well! 😄 I am passionate to work on this issue, if you can tell me, how should I go about the new fuselage message-parser, I would be more than grateful to you.

Hi! Thanks! I will ask one of our developers as I don't know about it too, hehehehe

henit-chobisa commented 1 year ago

Thank you so much, I made a body parser for Our Github App using Regex, here https://github.com/RocketChat/Apps.Github22/pull/32 This one also seems fun to work on, I would be more than happy to contribute to this! 🚀🚀🚀

xareyli commented 1 year ago

Oh, it seems that there is an assigned developer for this issue. @dudanogueira Should I notify that I'm working on an issue before creating PR?

P.S. Review https://github.com/RocketChat/Rocket.Chat/pull/27368

henit-chobisa commented 1 year ago

Hey @xareyli, I was researching this issue, came to both before and after message save callback chains, and was thinking of changing something in the message parser, but your solution of reversing the beforeSaveMessage callback chain seems super awesome!!! 😍😍 It would be awesome if you practice making a draft PR whenever you think of working on an issue, notifying other devs that you're working on the same.

dudanogueira commented 1 year ago

thanks @xareyli and @henit-chobisa for the interest! I asked already our devs to review this PR!

Really appreciate it :)

henit-chobisa commented 1 year ago

Pleasure to work @dudanogueira, Every line of RC teaches something! 🤩