Software /
code /
prosody
Diff
util/pubsub.lua @ 9098:d5bc306e93aa
util.pubsub: Look for a configured callback for more complicated access models
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 04 Aug 2018 03:04:00 +0200 |
parent | 9095:5639dc1a3f85 |
child | 9104:e1ca373a7e09 |
line wrap: on
line diff
--- a/util/pubsub.lua Sat Aug 04 03:38:55 2018 +0200 +++ b/util/pubsub.lua Sat Aug 04 03:04:00 2018 +0200 @@ -121,6 +121,16 @@ elseif access_model == "whitelist" then return "none"; end + + if self.config.access_models then + local check = self.config.access_models[access_model]; + if check then + local aff = check(actor); + if aff then + return aff; + end + end + end end function service:set_affiliation(node, actor, jid, affiliation)