Software /
code /
prosody
Comparison
plugins/mod_private.lua @ 6353:a868d5d6a83f
mod_private: Fix traceback due to missing table index
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 13 Aug 2014 19:19:34 +0200 |
parent | 6341:ab9a1af80632 |
child | 6354:bbb4a82db32e |
child | 6841:be87ab2d611c |
comparison
equal
deleted
inserted
replaced
6352:b703e6930e4c | 6353:a868d5d6a83f |
---|---|
25 if err then | 25 if err then |
26 return origin.send(st.error_reply(stanza, "wait", "internal-server-error", err)); | 26 return origin.send(st.error_reply(stanza, "wait", "internal-server-error", err)); |
27 end | 27 end |
28 if stanza.attr.type == "get" then | 28 if stanza.attr.type == "get" then |
29 if data and data[key] then | 29 if data and data[key] then |
30 return origin.send(st.reply(stanza):query("jabber:iq:private"):add_child(st.deserialize(data))); | 30 return origin.send(st.reply(stanza):query("jabber:iq:private"):add_child(st.deserialize(data[key]))); |
31 else | 31 else |
32 return origin.send(st.reply(stanza):add_child(query)); | 32 return origin.send(st.reply(stanza):add_child(query)); |
33 end | 33 end |
34 else -- type == set | 34 else -- type == set |
35 if not data then data = {}; end; | 35 if not data then data = {}; end; |