diff options
author | Kim Alvefur <zash@zash.se> | 2020-04-03 22:35:47 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-04-03 22:35:47 +0200 |
commit | 710339a8384dac99e332d05fcadbd87a4f2197b8 (patch) | |
tree | be353ee6d0583ea8fc675ea6c2cb291222f49be7 | |
parent | 7484fb15cba4cacd0125a63d78dcb781ba7a1d4f (diff) | |
download | prosody-710339a8384dac99e332d05fcadbd87a4f2197b8.tar.gz prosody-710339a8384dac99e332d05fcadbd87a4f2197b8.zip |
mod_vcard4: Report correct error condition (fixes #1521)
On error, the second return value is the error condition, not the third.
-rw-r--r-- | plugins/mod_vcard4.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_vcard4.lua b/plugins/mod_vcard4.lua index 378c0602..04dbca9e 100644 --- a/plugins/mod_vcard4.lua +++ b/plugins/mod_vcard4.lua @@ -14,9 +14,9 @@ module:hook("iq-get/bare/urn:ietf:params:xml:ns:vcard-4.0:vcard", function (even local ok, id, item = pep_service:get_last_item("urn:xmpp:vcard4", stanza.attr.from); if ok and item then origin.send(st.reply(stanza):add_child(item.tags[1])); - elseif item == "item-not-found" or not id then + elseif id == "item-not-found" or not id then origin.send(st.error_reply(stanza, "cancel", "item-not-found")); - elseif item == "forbidden" then + elseif id == "forbidden" then origin.send(st.error_reply(stanza, "auth", "forbidden")); else origin.send(st.error_reply(stanza, "modify", "undefined-condition")); |