nio icon indicating copy to clipboard operation
nio copied to clipboard

Pre-send hooks

Open kiliankoe opened this issue 5 years ago • 4 comments

Nio should be able to do some kind of pre-send processing of messages to allow for custom behavior such as linking GitHub issues (if applicable in some kind of user-configured context) or removing tracking params from URLs.

Somewhat related are special commands/messages that could be interpreted to edit earlier messages, like sed syntax.

kiliankoe avatar Jun 09 '20 07:06 kiliankoe

This is a great idea. For the specific case of GitHub, you can get existing bot config data from room state, so could populate per-room from there.

benparsons avatar Jun 09 '20 08:06 benparsons

Idea is great, but best solution must be on server side, not at client side. Maybe this can be implemented via some spam checker or third party rules plugin to Synapse?

MurzNN avatar Jun 09 '20 09:06 MurzNN

Just so I don't forget, quoting myself from here:

The ideal solution in my head would either already be doing such processing as you type (adding in the markdown link) or having some kind of indication on the message composer that what you have typed so far will lead to a pre-send-hook being triggered. I'm imagining something like a line above the composer stating "'#456' will be substituted with '[#456](some github link)'".

Tapping on that line would possibly disable that specific hook

kiliankoe avatar Jun 09 '20 11:06 kiliankoe

@MurzNN A server-side implementation of this would probably lose some transparency or at least make it quite a bit harder (like live checks and highlighting of substitutions). I also don't see why this has to be a server-side feature, afaict it fits rather nicely in the client-realm. Just like custom commands in Riot do.

Additionally, a server-side solution for this would probably be unusable with E2EE, at least how I would imagine this feature. Configs could (and probably should) of course be synced via the HS.

kiliankoe avatar Jun 09 '20 12:06 kiliankoe