Diff

mod_profile/mod_profile.lua @ 1423:4852fc446d26

mod_profile: Use the item id "current" as recomended in the Singleton Nodes section of XEP-0060
author Kim Alvefur <zash@zash.se>
date Fri, 30 May 2014 14:57:34 +0200
parent 1422:c3882787ae06
child 1424:9892a537e7fc
line wrap: on
line diff
--- a/mod_profile/mod_profile.lua	Fri May 30 14:55:54 2014 +0200
+++ b/mod_profile/mod_profile.lua	Fri May 30 14:57:34 2014 +0200
@@ -45,13 +45,13 @@
 	local pep = pep_plus.get_pep_service(username.."@"..module.host);
 	if vcard.to_vcard4 then
 		pep:purge("urn:xmpp:vcard4", true);
-		pep:publish("urn:xmpp:vcard4", true, "", st.stanza("item"):add_child(vcard.to_vcard4(data)));
+		pep:publish("urn:xmpp:vcard4", true, "current", st.stanza("item"):add_child(vcard.to_vcard4(data)));
 	end
 
 	local nickname = get_item(data, "NICKNAME");
 	if nickname and nickname[1] then
 		pep:purge("http://jabber.org/protocol/nick", true);
-		pep:publish("http://jabber.org/protocol/nick", true, "", st.stanza("item")
+		pep:publish("http://jabber.org/protocol/nick", true, "current", st.stanza("item")
 			:tag("nick", { xmlns="http://jabber.org/protocol/nick" }):text(nickname[1]));
 	end
 
@@ -62,7 +62,7 @@
 
 		pep:purge("urn:xmpp:avatar:metadata", true);
 		pep:purge("urn:xmpp:avatar:data", true);
-		pep:publish("urn:xmpp:avatar:metadata", true, "", st.stanza("item")
+		pep:publish("urn:xmpp:avatar:metadata", true, "current", st.stanza("item")
 			:tag("metadata", {
 				xmlns="urn:xmpp:avatar:metadata",
 				bytes = tostring(#photo_raw),