Changeset

8332:e89b57d0d80a

mod_pep_plus: Advertise additional features not covered by inspection of pubsub service methods
author Kim Alvefur <zash@zash.se>
date Tue, 17 Oct 2017 05:30:09 +0200
parents 8331:8df0eaa564f0
children 8333:2abbb01cd756
files plugins/mod_pep_plus.lua
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)