Hi Chris,

On 25 May 2016 at 22:16, Chris Ballinger <chrisballin...@gmail.com> wrote:
> Not sure about the proper way to submit a pull request, but we have some
> proposed modifications to the existing module that I'd like some feedback on
> first.

I'm working on some 'contributing' docs :) But summary is - however
you want to send a pull request. For small changes, sending a patch
here is fine. For larger changes, either email a bundle (generated
with 'hg bundle') to develop...@prosody.im, or point us to a repo we
can pull from.

> 1. push_enabled is not persisted across server restarts (only reloads). This
> means that users won't receive pushes until they login again. Is there an
> easy way to accomplish this with the existing persistent storage API? I had
> trouble finding docs for the storage API.

You're right, I thought we had this documented.

First, open the store using module:open_store():
https://prosody.im/doc/developers/moduleapi#storage

Once you have the store, you can call store:get(username) and
store:set(username, data).

Example:

```
local prefs_store = module:open_store("cloud_notify_preferences");

prefs_store:set("myusername", { push_enabled = true });

local user_preferences = prefs_store:get("myusername");

if user_preferences and user_preferences.push_enabled then
   -- Push
end
```

> 2. pushes are triggered for typing notifications (and possibly other
> extraneous stanzas as well). Would this be desired for some use cases and
> configurable (for instance to wake up the receiving client more quickly), or
> would it be better to just filter out all messages without a body?

I don't see any typical use cases for no-body messages being pushed.
If someone wants that, they are probably happy customizing the module
to pluck out the information they want to send, and it wouldn't be a
difficult change. I say discard messages that don't have a body right
now.

Regards,
Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to