aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-20 14:29:20 +0200
committerKim Alvefur <zash@zash.se>2018-10-20 14:29:20 +0200
commit3a254f523d552d8d6096a9d03e8d6cbff96b9e8d (patch)
tree8f68436de84f868c92d8f485b6fe95dfd9628479 /plugins
parentfad565ca61255a3f0a23599d4e44df9efed89764 (diff)
downloadprosody-3a254f523d552d8d6096a9d03e8d6cbff96b9e8d.tar.gz
prosody-3a254f523d552d8d6096a9d03e8d6cbff96b9e8d.zip
mod_vcard_legacy: Pass node defaults to publish instead of create
The create calls were introduced in 62fa766d8f3 but work on this started a while before 038446c50630 allowed passing the _defaults_only flag to publish.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_vcard_legacy.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/mod_vcard_legacy.lua b/plugins/mod_vcard_legacy.lua
index 8b9c86f2..cf0724f3 100644
--- a/plugins/mod_vcard_legacy.lua
+++ b/plugins/mod_vcard_legacy.lua
@@ -154,13 +154,8 @@ module:hook("iq-set/self/vcard-temp:vCard", function (event)
if pep_service:purge("urn:xmpp:avatar:metadata", origin.full_jid) then
pep_service:purge("urn:xmpp:avatar:data", origin.full_jid);
- else
- pep_service:create("urn:xmpp:avatar:metadata", origin.full_jid, node_defaults);
- pep_service:create("urn:xmpp:avatar:data", origin.full_jid, node_defaults);
end
- pep_service:create("urn:xmpp:vcard4", origin.full_jid, node_defaults);
-
vcard4:tag("fn"):text_tag("text", vcard_temp:get_child_text("FN")):up();
local N = vcard_temp:get_child("N");
@@ -253,9 +248,9 @@ module:hook("iq-set/self/vcard-temp:vCard", function (event)
:tag("data", { xmlns="urn:xmpp:avatar:data" })
:text(avatar_payload);
- local ok, err = pep_service:publish("urn:xmpp:avatar:data", origin.full_jid, avatar_hash, avatar_data)
+ local ok, err = pep_service:publish("urn:xmpp:avatar:data", origin.full_jid, avatar_hash, avatar_data, node_defaults)
if ok then
- ok, err = pep_service:publish("urn:xmpp:avatar:metadata", origin.full_jid, avatar_hash, avatar_meta);
+ ok, err = pep_service:publish("urn:xmpp:avatar:metadata", origin.full_jid, avatar_hash, avatar_meta, node_defaults);
end
if not ok then
handle_error(origin, stanza, err);
@@ -265,7 +260,7 @@ module:hook("iq-set/self/vcard-temp:vCard", function (event)
end
end
- local ok, err = pep_service:publish("urn:xmpp:vcard4", origin.full_jid, "current", vcard4);
+ local ok, err = pep_service:publish("urn:xmpp:vcard4", origin.full_jid, "current", vcard4, node_defaults);
if ok then
origin.send(st.reply(stanza));
else