comparison mod_profile/mod_profile.lua @ 1469:019746bba318

mod_profile: Add the missing <info> child element and move info attributes there
author Kim Alvefur <zash@zash.se>
date Tue, 08 Jul 2014 02:54:04 +0200
parents 843769eb40c3
children b291a9423e0f
comparison
equal deleted inserted replaced
1468:cf32265eb4c7 1469:019746bba318
66 local photo_hash = sha1(photo_raw, true); 66 local photo_hash = sha1(photo_raw, true);
67 67
68 pep:purge("urn:xmpp:avatar:metadata", true); 68 pep:purge("urn:xmpp:avatar:metadata", true);
69 pep:purge("urn:xmpp:avatar:data", true); 69 pep:purge("urn:xmpp:avatar:data", true);
70 pep:publish("urn:xmpp:avatar:metadata", true, "current", st.stanza("item", {id="current"}) 70 pep:publish("urn:xmpp:avatar:metadata", true, "current", st.stanza("item", {id="current"})
71 :tag("metadata", { 71 :tag("metadata", { xmlns="urn:xmpp:avatar:metadata" })
72 xmlns="urn:xmpp:avatar:metadata", 72 :tag("info", {
73 bytes = tostring(#photo_raw), 73 bytes = tostring(#photo_raw),
74 id = photo_hash, 74 id = photo_hash,
75 type = identify(photo_raw), 75 type = identify(photo_raw),
76 })); 76 }));
77 pep:publish("urn:xmpp:avatar:data", true, photo_hash, st.stanza("item", {id="current"}) 77 pep:publish("urn:xmpp:avatar:data", true, photo_hash, st.stanza("item", {id="current"})
78 :tag("data", { xmlns="urn:xmpp:avatar:data" }):text(photo[1])); 78 :tag("data", { xmlns="urn:xmpp:avatar:data" }):text(photo[1]));
79 end 79 end
80 end 80 end
81 81