Feature #1108

avatar

Allow to modify/transform/replace/drop messages in scripts

Added by Mirco Bauer 2731 days ago.

Status:New Start:07/05/2017
Priority:Normal Due date:
Assigned to:avatarMirco Bauer % Done:

0%

Category:Engine
Target version:-
Complexity:

Medium

Votes: 0

Description

Smuxi allows you to write scripts that react to events like receiving a message. Scripts can also execute commands like a user can do. But a script cannot modify a message or even drop it.
This can be useful for different things like transforming shortened URLs to the real URL or to detect bad messages and discard them so the user doesn't need to see them.

Specification:
a JSON serialized version of a message needs to be passed to the hook as an environment variable so that the script can inspect the original full message.
In order to modify or discard the message there needs to be a command that can be written to stdout of the script, like:
TransformMessage JSON_OF_NEW_MESSAGE
and
DiscardMessage

How this integrates with Smuxi filters feature remains to be checked.

Also available in: Atom PDF