Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-21 Thread Simon Hill
Thank you. That worked! Here's the working code: https://gist.github.com/metalaureate/071148513466e24224f2 On Sat, Mar 21, 2015 at 8:33 AM, Kim Alvefur wrote: > On 2015-03-21 16:19, Simon Hill wrote: > > The /email/ var is returning as empty. > > Note that does not contain the email address di

Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-21 Thread Kim Alvefur
On 2015-03-21 16:19, Simon Hill wrote: > The /email/ var is returning as empty. Note that does not contain the email address directly, but as a child element . So you will need to do email = vcard:get_child("EMAIL"); email = email and email:get_child_text("USERID"); to get the actual email add

Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-21 Thread Simon Hill
Thanks Waqas! I got this far (after adding jid_split function): if text then local username = jid_split(stanza.attr.to); module:log("info", "vCard for %s", username); local email; -- nil by default local vCardRaw = vcards:get(username); if vCardRaw then local vcard =

Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-20 Thread Waqas Hussain
Hey Simon, you have two problems. 1) jid_bare gives you usern...@example.com. You just want username, without the @hostname, so use jid_split 2) You don't check for the vCard being nil (i.e., the user has no vCard data stored) Here's what your code could look like: local username=jid_split(stanz

Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-20 Thread Simon Hill
Hi Matthew, I have not exactly gotten it working and wondered if you had any further thoughts. Must be doing something stupid. In the logs: *info* vCard for u...@domain.com > [xmpp-1] 2015-03-20T21:59:51.813731734Z mod_bosh > *error* Traceback[bosh]: > ...sod

Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-20 Thread Simon Hill
Thanks Matt! Chuffed to get a response from the author! Your caveats are agreed and understood - my modification is for a closed implementation. Prosody is backing a social network / game launching soon. On Friday, March 20, 2015 at 3:28:56 AM UTC-7, Matthew Wild wrote: > > On 20 March 2015 at 0

Re: [prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-20 Thread Matthew Wild
On 20 March 2015 at 00:56, Simon Hill wrote: > I promise to get better at Lua and Prosody - currently I am a noob and ask a > lot of stupid questions. Here's my question: > > I am trying to add vCard support to mod_offline_email. Zash kindly > suggested: > >> local vcards = module:open_store("vcar

[prosody-dev] Problems adding vCard to support for email forwarding on v.10

2015-03-20 Thread Simon Hill
I promise to get better at Lua and Prosody - currently I am a noob and ask a lot of stupid questions. Here's my question: I am trying to add vCard support to mod_offline_email. Zash kindly suggested: local vcards = module:open_store("vcard"); > -- in a hook > local vcard = vcards:get(username