matrix-react-sdk
matrix-react-sdk copied to clipboard
Bridge limitation warnings
Fixes https://github.com/matrix-org/matrix-appservice-irc/issues/701
Paired with https://github.com/matrix-org/matrix-appservice-irc/pull/1057
Example of the popover:

Example of the new settings page details:

This feature looks at the bridge state event(s) for a room, and then checks limitations described in those events against the message content a user is about to send. The objective is to avoid matrix users sending messages that are incompatible or badly represented in a bridge rather than mangling the format on the bridge and upsetting remote users.
This PR currently fixes one problem: Matrix users send long messages which the IRC bridge is forced to store in a pastebin, rather than sending over the wire as IRC traditionally dislikes long messages.
There will be an extension MSC coming soon to cover the new keys added to MSC2346.
In terms of what's left to do:
- [ ] ~~Limit users ability to send messages that breach limitations~~ (N/A - I don't think we want this)
- [ ] ~~Allow users to permanently disregard the warning~~ (N/A - we no longer block the user from sending)
- [x] Highlight the limitations in the bridge settings tab
What about reactions/edits/redactions? Shouldn't they warn too?
What about reactions/edits/redactions? Shouldn't they warn too?
Yep, this is just a first pass. Once there is general happiness noises from product/design about the idea of a bridge interrupting your messaging, I'll want to add limitation categories for event types.
Matrix users send long messages which the IRC bridge is forced to store in a pastebin, rather than sending over the wire as IRC traditionally dislikes long messages.
The copy in the dialog doesn't explain that this is what would happen if they ignore the warning.
The copy in the dialog doesn't explain that this is what would happen if they ignore the warning.
Yeah, this is a sore point. The IRC bridge can't send it's own warnings because they will appear as English in the client, and I want to keep the ability for i18n. Riot however doesn't know about the pastebin aspect, unless we stick some sort of key into the event content to state this.
I was tempted to have a "consequeneces": ["pastebin"] and leave it up to Riot to translate that to words, but I think it's a bit too bridge specific to spec. The one thing we could do is a "consequeneces": ["org.matrix.appservice-irc.pastebin"] and Riot would know to translate irc bridge specific issues into words.
Alternative solutions I might have missed v.welcome though :)
I'm sure you've already covered splitting long messages (splitlong.pl & similar), but where?
I'm sure you've already covered splitting long messages (splitlong.pl & similar), but where?
We've not covered line splitting on the client-side. This a deliberately dumb metric that counts characters to give a rough warning. I'm not sure how best to factor in line splitting as a warning.