Changeset

9099:974b25c27f24

mod_pep: Move subscriber check into 'presence' access model callback
author Kim Alvefur <zash@zash.se>
date Sat, 04 Aug 2018 03:13:26 +0200
parents 9098:d5bc306e93aa
children 9100:e01c7d0cbbf4
files plugins/mod_pep.lua
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pep.lua	Sat Aug 04 03:04:00 2018 +0200
+++ b/plugins/mod_pep.lua	Sat Aug 04 03:13:26 2018 +0200
@@ -240,11 +240,17 @@
 		get_affiliation = function (jid)
 			if jid_bare(jid) == user_bare then
 				return "owner";
-			elseif subscription_presence(username, jid) then
-				return "subscriber";
 			end
 		end;
 
+		access_models = {
+			presence = function (jid)
+				if subscription_presence(username, jid) then
+					return "subscriber";
+				end
+			end;
+		};
+
 		normalize_jid = jid_bare;
 
 		check_node_config = check_node_config;