plugins/mod_vcard.lua

changeset 2000
c31aa53348b8
parent 1957
5856b2dcf81e
child 2001
2f73fe2b3edd
equal deleted inserted replaced
1999:05054e360d89 2000:c31aa53348b8
38 session.send(st.reply(stanza):add_child(vCard)); -- send vCard! 38 session.send(st.reply(stanza):add_child(vCard)); -- send vCard!
39 else 39 else
40 session.send(st.error_reply(stanza, "cancel", "item-not-found")); 40 session.send(st.error_reply(stanza, "cancel", "item-not-found"));
41 end 41 end
42 elseif stanza.attr.type == "set" then 42 elseif stanza.attr.type == "set" then
43 if not to or to == session.username.."@"..session.host then 43 if not to then
44 if datamanager.store(session.username, session.host, "vcard", st.preserialize(stanza.tags[1])) then 44 if datamanager.store(session.username, session.host, "vcard", st.preserialize(stanza.tags[1])) then
45 session.send(st.reply(stanza)); 45 session.send(st.reply(stanza));
46 else 46 else
47 -- TODO unable to write file, file may be locked, etc, what's the correct error? 47 -- TODO unable to write file, file may be locked, etc, what's the correct error?
48 session.send(st.error_reply(stanza, "wait", "internal-server-error")); 48 session.send(st.error_reply(stanza, "wait", "internal-server-error"));

mercurial