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.68k stars 620 forks source link

Cross-platform message deletion tool #1737

Open gamelaster opened 2 years ago

gamelaster commented 2 years ago

Is your feature request related to a problem? Please describe. PINE64 Community hosts a matterbridge, which bridges over 15 chats rooms between 4 platforms. Since there is a lot of chatrooms with quite high activity, moderating is very problematic, because there is no way of deleting a single message between all platforms.

Describe the solution you'd like Create a way of deleting the messages, which will be deleted on every platform. (Maybe API?)

Describe alternatives you've considered I created fork of matterbridge, where I integrated HTTP REST endpoint, which can delete message across the platforms by Discord Message ID. This endpoint uses mechanism which is used when user deletes his message, thus endpoint look up into cache, find the message IDs in other platforms and sends the message deletion request into every bridge. This is working fine, but only for pure text messages. If there is any attachment, it's problematic. In case of Discord, if there is attachment used, the message ID is not saved into cache (I fixed it easily). Although, for example, Telegram deletes only message with file name, not the image/attachment itself, and Matrix doesn't delete image at all (maybe similar problem to Discord one?).

Additional context I created this issue, because the fork I made contains still more and more core changes, so maintaining latest version of matterbridge and also the cross platform deletion feature will be problematic. Also I found that this tool can be useful for other communities which struggle with same issue, so I think the proper implementation within matterbridge would be best.

42wim commented 2 years ago

Matterbridge should delete the message if the bridge supports it, so deleting the message on eg the discord bridge should already work, if it doesn't do this, this is a bug :)

Of course I'm open for PR's that improves this. Where can I find your fork?

yousefmansy1 commented 1 year ago

Matterbridge should delete the message if the bridge supports it, so deleting the message on eg the discord bridge should already work, if it doesn't do this, this is a bug :)

Of course I'm open for PR's that improves this. Where can I find your fork?

The way this works right is that deletes will only propagate if they're deleted from the "canonical" chat.

Eg: a message sent from whatsapp, then deleted from discord will not propogate the message delete. I have my own little fix here: 655b70f606c4fc9626cc2d270799f8e0bc6a58a2 And it works but for some reason it will delete all messages, except the original message.

MoralCode commented 3 days ago

I have my own little fix here: 655b70f And it works but for some reason it will delete all messages, except the original message.

do you have more details on why it needs to exclude the original message? I think this is the last remaining piece for this to be usable for my usecase.