Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

Support for client-side code

Open cardoso opened this issue 7 years ago • 0 comments

It would be useful to have some capability for running code in the client-side with local storage and external request options.

The first use case that comes to mind is custom E2E encryption solutions, but also other things would be possible like local translation.

I think we can begin by implementing some hooks like:

function preMessageSend(Message, IRead, IModify, IPersistence) {
    // client will run this code when sending a message and possibly transform it
    return Message // return false to prevent message from being sent
}

function onMessageReceive(Message, IRead, IModify, IPersistence) {
    // client will run this code when message is received and possibly transform it
    return Message // return false to filter out the message?
}

This should not be hard to implement on iOS or Android, since both have powerful native JavaScript interop.

cardoso avatar Aug 01 '18 17:08 cardoso