Software /
code /
prosody
Changeset
6657:f1af4edd5722
mod_pubsub: Add option for default affiliation of non-existent nodes (thanks Flow)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 05 May 2015 12:21:32 +0200 |
parents | 6649:99fa40d498cc |
children | 6658:65563530375b |
files | plugins/mod_pubsub/mod_pubsub.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua Tue May 05 00:48:55 2015 +0200 +++ b/plugins/mod_pubsub/mod_pubsub.lua Tue May 05 12:21:32 2015 +0200 @@ -125,11 +125,15 @@ end); local admin_aff = module:get_option_string("default_admin_affiliation", "owner"); -local function get_affiliation(jid) +local unowned_aff = module:get_option_string("default_unowned_affiliation"); +local function get_affiliation(jid, node) local bare_jid = jid_bare(jid); if bare_jid == module.host or usermanager.is_admin(bare_jid, module.host) then return admin_aff; end + if not node then + return unowned_aff; + end end function set_service(new_service)