is there any concept of domain events in discourse? We’d like our app to be notified of certain events within discourse.
If not we’ll be looking at creating this as some sort of extension but I do think there’d need to be code added to the main code in order to fire the events.
Ideally the aggregator would be generic so we (or anyone) can plug in their own mechanism for consuming or forwarding these events.
I guess it’s things that would be interesting to the user still in our app but outside of discourse. So off the top of my head:
@mentions
badge awarded
etc
Basically whenever there is a notification in the header for a user - we could then listen out for these events (probably by subscribing to RabbitMQ topics) and forward the notifications in our header.
You can request /notifications.json?silent=true&api_username=$username&api_key=$master_api_key (FROM THE SERVER TO DISCOURSE - do not ship the master api key to clients)
This will give you the notifications, without marking them as seen (clearing the blue indicator).
(The master API key lets you perform requests as any user.)