Diff

plugins/mod_vcard_legacy.lua @ 10268:210278d5f995 0.11

mod_vcard_legacy: Advertise lack of avatar correctly (fixes #1431) (thanks lovetox)
author Kim Alvefur <zash@zash.se>
date Sat, 21 Sep 2019 15:20:50 +0200
parent 9814:5eb4ef537e98
child 10269:4701415f5b0e
line wrap: on
line diff
--- a/plugins/mod_vcard_legacy.lua	Wed Sep 11 15:03:54 2019 +0100
+++ b/plugins/mod_vcard_legacy.lua	Sat Sep 21 15:20:50 2019 +0200
@@ -301,10 +301,10 @@
 	local pep_service = mod_pep.get_pep_service(username);
 
 	stanza:remove_children("x", "vcard-temp:x:update");
-	local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" });
+	local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }):tag("photo");
 	local ok, avatar_hash = pep_service:get_last_item("urn:xmpp:avatar:metadata", true);
 	if ok and avatar_hash then
-		x_update:text_tag("photo", avatar_hash);
+		x_update:text(avatar_hash);
 	end
 	stanza:add_direct_child(x_update);
 end