feat: fire new `push_send_notification` hook
Do not route XEP-357 IQ notification directly but run it through registered hooks that will ultimately decide whether or not send it and, if needed, customize the notification contents.
Hooks can return:
- a modified IQ packet, as per their business logic
- the atom
drop, to effectively cancel the push notification
The idea behind this modification is to allow module developers to create modules that can customize the contents of the emitted push notifications. In our specific case, we use this hook to inspect the full message responsible of triggering the push notification and add some custom fields to the XEP-0357 IQ. Moreover, the return value of drop will skip sending the push notification at all if needed.
I'm open for suggestions on the Hook name, if any other fits better.
I'd also like to know if any other developer is using Emacs and elp. I've been having some trouble matching the indentation of the original file's revision (and it still doesn't fully match it, but elvis didn't complain). Any tip is welcome.
coverage: 33.588% (+0.001%) from 33.587% when pulling cda1d4ce7fb46588341b00ad0f32ca4416dbc098 on Quobis:add-push-send-notification-hook into 128103b7b221c188629528b8320a41d1ac10defc on processone:master.
Any feedback on this one? Should I gather there's no interest in it? :slightly_smiling_face:
Should I gather there's no interest in it? 🙂
No I think the hook makes sense, will have a look this week. Thanks for the ping.
Thanks, and sorry for the delay.