Changeset

10270:c2b9ff42db03

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 21 Sep 2019 16:50:29 +0200
parents 10267:9ef1e26594cb (current diff) 10269:4701415f5b0e (diff)
children 10271:2f30ad040454
files plugins/mod_vcard_legacy.lua prosodyctl
diffstat 3 files changed, 26 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Sep 19 22:53:00 2019 +0200
+++ b/.hgtags	Sat Sep 21 16:50:29 2019 +0200
@@ -69,3 +69,4 @@
 91856829f18bb8ef7056ca02464122fc6de17807 0.11.1
 bb8486491b48431236c0d32548c20d9853781e69 0.10.3
 4f8b6c09e5f328e3d3d4233dc78fa4fd0535171c 0.11.2
+dd7e924c74ef27b7f92eb872d2db50aaa229b234 0.11.3
--- a/plugins/mod_vcard_legacy.lua	Thu Sep 19 22:53:00 2019 +0200
+++ b/plugins/mod_vcard_legacy.lua	Sat Sep 21 16:50:29 2019 +0200
@@ -321,13 +321,19 @@
 	if stanza.attr.type then return end
 	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 = stanza:get_child("x", "vcard-temp:x:update");
+	if not x_update then
+		x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }):tag("photo");
+		stanza:add_direct_child(x_update);
+	elseif x_update:get_child("photo") then
+		return; -- XEP implies that these should be left alone
+	else
+		x_update:tag("photo");
+	end
 	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
 
 module:hook("pre-presence/full", inject_xep153, 1);
--- a/prosodyctl	Thu Sep 19 22:53:00 2019 +0200
+++ b/prosodyctl	Sat Sep 21 16:50:29 2019 +0200
@@ -1142,17 +1142,21 @@
 
 			if modules:contains("proxy65") then
 				local proxy65_target = configmanager.get(host, "proxy65_address") or host;
-				local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");
-				local prob = {};
-				if not A then
-					table.insert(prob, "A");
-				end
-				if v6_supported and not AAAA then
-					table.insert(prob, "AAAA");
-				end
-				if #prob > 0 then
-					print("    File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/")
-					.." record. Create one or set 'proxy65_address' to the correct host/IP.");
+				if type(proxy65_target) == "string" then
+					local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");
+					local prob = {};
+					if not A then
+						table.insert(prob, "A");
+					end
+					if v6_supported and not AAAA then
+						table.insert(prob, "AAAA");
+					end
+					if #prob > 0 then
+						print("    File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/")
+						.." record. Create one or set 'proxy65_address' to the correct host/IP.");
+					end
+				else
+					print("    proxy65_address for "..host.." should be set to a string, unable to perform DNS check");
 				end
 			end