Changeset

10707:c4b49939b471 0.11

mod_vcard4: Report correct error condition (fixes #1521) On error, the second return value is the error condition, not the third.
author Kim Alvefur <zash@zash.se>
date Fri, 03 Apr 2020 22:35:47 +0200
parents 10703:6b63ba5b078a
children 10708:6119e4f87c32 10709:fcf7f50ccdd0
files plugins/mod_vcard4.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_vcard4.lua	Sun Sep 29 15:05:17 2019 +0200
+++ b/plugins/mod_vcard4.lua	Fri Apr 03 22:35:47 2020 +0200
@@ -14,9 +14,9 @@
 	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"));