42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.52k stars 616 forks source link

IRC: prevent code blocks from spamming IRC users #1251

Open bluddy opened 3 years ago

bluddy commented 3 years ago

I'm using matterbridge to bridge discord to IRC. My IRC users are complaining that code blocks posted on discord spam their IRC clients.

It would be nice to have an option to either filter out code blocks or - even fancier - allow automatic uploading of code blocks to one of the services used by IRC folks for this purpose. I'd be happy with the simpler solution.

BTW, I'm not sure why code blocks aren't recognized as one message by matterbridge and therefore limited to 400 chars.

qaisjp commented 3 years ago

I believe that messages sent on multiple lines on Discord will appear on multiple lines on IRC. The newlines aren't converted to spaces, and explains the "spam" on IRC.

Better handling on text formatting is something that I think we should add, it's just really difficult as every single chat platform has their own little dialect, and it's very frustrating. At least Discord is actually real markdown!

Once we have actual text message parsing working, then this feature will be possible.


Note that irccloud will actually recognise markdown sent across multiple messages and convert them to code blocks, e.g.:

<qaisjp> ```
<qaisjp> some
<qaisjp> code
<qaisjp> here
<qaisjp> ```

Will appear as this:

image

leostera commented 3 years ago

@qaisjp did I understand that a multiline code block from Discord will be seen as multiple lines by matterbridge ?

qaisjp commented 3 years ago

Yes

NoXPhasma commented 2 years ago

This is still an issue with v1.23.2.