mod_pep_plus: Advertise additional features not covered by inspection of pubsub service methods
authorKim Alvefur <zash@zash.se>
Tue, 17 Oct 2017 05:30:09 +0200
changeset 8335 e89b57d0d80a
parent 8334 8df0eaa564f0
child 8336 2abbb01cd756
mod_pep_plus: Advertise additional features not covered by inspection of pubsub service methods
plugins/mod_pep_plus.lua
--- a/plugins/mod_pep_plus.lua	Tue Oct 17 20:50:59 2017 +0200
+++ b/plugins/mod_pep_plus.lua	Tue Oct 17 05:30:09 2017 +0200
@@ -420,6 +420,7 @@
 	local origin, reply = event.origin, event.reply;
 
 	reply:tag('identity', {category='pubsub', type='pep'}):up();
+	reply:tag('feature', {var=xmlns_pubsub}):up();
 
 	local username = jid_split(reply.attr.from) or origin.username;
 	local service = get_pep_service(username);
@@ -451,6 +452,20 @@
 			reply:tag('feature', {var=xmlns_pubsub.."#"..affiliation.."-affiliation"}):up();
 		end
 	end
+
+	-- Features not covered by the above
+	local more_features = {
+		"access-presence",
+		"auto-subscribe",
+		"filtered-notifications",
+		"last-published",
+		"persistent-items",
+		"presence-notifications",
+		"presence-subscribe",
+	};
+	for _, feature in ipairs(more_features) do
+		reply:tag('feature', {var=xmlns_pubsub.."#"..feature}):up();
+	end
 end);
 
 module:hook("account-disco-items-node", function(event)