matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
791 stars 148 forks source link

feat: support opt-in for anonymous bridging #856

Open SethFalco opened 1 year ago

SethFalco commented 1 year ago

Problem

In large communities, some users are uncomfortable with their messages being bridged to a platform outside their own. While Discord isn't exactly known for being privacy-respecting… it's not an unfounded concern that you want your message to be confined to the platforms you sent them on.

Currently, users have to make a decision, do they mind the bridge and stay active, or do they have problems with the bridge and no longer engage in the community altogether?

Solution

I have 3 proposed solutions to this which will hopefully create a middle-ground.

Anonymous Bridging

Make a way for users to opt-in for anonymous bridging. This will create a puppet user who doesn't use the username, discriminator, display name, avatar, or ID of the user on Matrix.

The message content will still be bridged, but the details of the Discord user will not be revealed.

The following information will be replaced:

So the puppet might look like: ID: @_discord_d04b98f48e8f8bcc15c6ae5ac050801cd6dcfd428fb5f9e65c4e16e7807340fa:t2bot.io Display Name: Anonymous 807340fa

I think this solution is viable and would work quite well in the bot, however with content still being bridged it does not address the entire problem.

Bridging Opt-out

Users could have the choice to opt-out of the bridge entirely.

Pro: Users can opt out if they want to participate in the community but don't want the messages to leave the platform. Con: Impedes on the bridge as Matrix users will get an incomplete view of the conversation.

If this were to be implemented, there would need to be a config which is disabled by default. Then hosts can choose to enable this if they want to allow users on Discord to opt-out.

This solution would be a nice choice for users to have, but impedes on the usability of the bridge. I do like the idea of users having this choice, but it might not make much sense to implement it overall.

Bypass Bridge Command

Finally, there could be a command that's added where that particular message bypasses the bridge.

For example, !matrix bypass Message content here.

This one would be a bit clunky to use, but would allow users to send a message which the bot ignores. So no warnings/errors are displayed for it to be another command, but also the message is not bridged across.

State

To track the user's choice, there could either be:

Both could be done together too, for example the command could be used to have the bot add or remove the role from the user. (This way the state can be tracked on Discord, and admins of the Discord server manage it for users rather than instruct them to do commands if required.)

If the state is managed internally, then the command can be used to globally opt the user out. If the state is managed via a role, then the command is local to a Discord guild.

Open Questions

I don't think in many places in the bot we have guild-scoped settings anywhere?

Would it be worth adding settings that guilds could change if they don't want to self-host, but do want to tweak how the bot runs them? I think currently the idea is that if a guild wants to tweak behavior, they should self-host?