Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribing to incoming messages from a plugin #3

Open
c-mueller opened this issue Mar 10, 2019 · 4 comments
Open

Subscribing to incoming messages from a plugin #3

c-mueller opened this issue Mar 10, 2019 · 4 comments
Labels

Comments

@c-mueller
Copy link

I was thinking about writing a plugin to send a E-Mail containing a receieved notfication, but the current APIs exposed to plugins do not seem to support the subscription to incoming messages. I.e. it is not possible to have a plugin act as a client. At least that's what I'm concluding from your docs.

I therefore want to ask if such a feature is planned for the future.

@eternal-flame-AD
Copy link
Member

eternal-flame-AD commented Mar 10, 2019

This is currently not in our TODOs. You can refer to the original discussion(See Whether to build a plugin section) on plugin feature to get an idea on how we defined plugins. In short, a plugin is a dedicated program which has some APIs exposed to the gotify main program. Currently, it was implemented because we want to prevent such scenario to make your server full of all kinds of processes, which are difficult to maintain: you need to subscribe to a lot of feeds, so you need to maintain a large number of programs to listen on each of the feeds. Gotify plugins provided a simple and elegant way to sort out all your subscriptions with direct configuration on the WebUI and easy on/off switch.

As for your request, I do not see a case where users would need to maintain a relatively large number of processes(>3) to obtain incoming messages. Thus, I would recommend writing a simple program that listens to gotify messages and forwards them to your e-mail.

This is my consideration on this issue. Feel free to reply if you have your own considerations on what problems should plugins resolve.:)

@jmattheis jmattheis transferred this issue from gotify/server Mar 14, 2019
@jmattheis
Copy link
Member

Let's wait till more users want this feature.

@nicoulaj
Copy link

As briefly discussed on the matrix chat, I would also like to see such an API for a few use cases:

  1. Predicate: be able to drop messages as they are received
  2. Message transformer (1 Message -> 1 Message): eg, for rewriting message contents (I have a few apps that send poorly worded notifications, or with too much info)
  3. Message buffer: eg, for bufferizing N messages from a spammy client, and sending one aggregated message every hour

All of this can be done with a single, simple plugin API (just a single method that takes a Message and returns a Message or null)

@dev-techmoe
Copy link

Thus, I would recommend writing a simple program that listens to gotify messages and forwards them to your e-mail.

In my option it's too ugly for project structure because it brings more unnecessary maintenance costs, I think Gotify should become a bridge between apps and other clients, and the step of pushing to other clients should also execute by Gotify with plugins without any additional apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants