Re: [prosody-dev] Need help writing a module

2017-07-08 Thread James Cloos
> Kim Alvefur  writes:

> This module is pretty close to what you want, it should be a simple
> matter to adjust the accepted syntax to your specific needs.

> https://modules.prosody.im/mod_post_msg.html

Thanks.  I read thru many of the modules in hg, including that one, and
learned quite a bit about how prosody modules are coded in the process,
but it was not enough.

I have gotten a offlist reply, though, and expect the help offerred
there to be enough to get this completed.

-JimC
-- 
James Cloos  OpenPGP: 0x997A9F17ED7DAEA6

-- 
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.


Re: [prosody-dev] Need help writing a module

2017-07-08 Thread Kim Alvefur
Hi,

On Thu, Jul 06, 2017 at 04:45:16PM -0400, James Cloos wrote:
> I need some help getting a module working for prosody.
> 
> It needs to listen on a localhost tcp socket and accept http POSTs
> with json bodies akin to:
> 
>{"from":"8...@x.example.net", "to":"9...@x.example.net", "body":"Hello"}
> 
> and confirm that the to's domain is served locally (this install does
> not do s2s) and if so, send the message.
> 
> Authentication will be done outside of prosody; the module does not
> have to deal with auth, just send whatever it gets.
> 
> If the domain is not local, a 400 reply should be sent, with:
> 
>   {false}
> 
> and if the domain is local, a 200 with:
> 
>   {true}
> 
> and Content-Type applicaion/json in both cases.
> 
> I wrote a module based on what is in the prosody-modules repo, but
> have not managed to get it to work.
> 
> Can anyone help out?

This module is pretty close to what you want, it should be a simple
matter to adjust the accepted syntax to your specific needs.

https://modules.prosody.im/mod_post_msg.html

-- 
Zash

-- 
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.