Comparison

util/pubsub.lua @ 9160:e13a1a0b0107

mod_pep, util.pubsub: Rename restricted->outcast, none->member and add new 'none' affiliation to better match XEP-0060
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 Aug 2018 23:20:07 +0100
parent 9158:37e814a680ab
child 9161:da154ced7de4
comparison
equal deleted inserted replaced
9159:a0fd7064f4ac 9160:e13a1a0b0107
8 broadcaster = function () end; 8 broadcaster = function () end;
9 itemcheck = function () return true; end; 9 itemcheck = function () return true; end;
10 get_affiliation = function () end; 10 get_affiliation = function () end;
11 normalize_jid = function (jid) return jid; end; 11 normalize_jid = function (jid) return jid; end;
12 capabilities = { 12 capabilities = {
13 restricted = { 13 outcast = {
14 be_subscribed = false; 14 be_subscribed = false;
15 be_unsubscribed = true; 15 be_unsubscribed = true;
16 }; 16 };
17 none = { 17 none = {
18 create = false;
19 publish = false;
20 retract = false;
21 get_nodes = true;
22
23 subscribe = true;
24 unsubscribe = true;
25 get_subscription = true;
26 get_subscriptions = true;
27 get_items = false;
28
29 subscribe_other = false;
30 unsubscribe_other = false;
31 get_subscription_other = false;
32 get_subscriptions_other = false;
33
34 be_subscribed = true;
35 be_unsubscribed = true;
36
37 set_affiliation = false;
38 };
39 member = {
18 create = false; 40 create = false;
19 publish = false; 41 publish = false;
20 retract = false; 42 retract = false;
21 get_nodes = true; 43 get_nodes = true;
22 44
194 or self.node_defaults.access_model; 216 or self.node_defaults.access_model;
195 217
196 if access_model == "open" then 218 if access_model == "open" then
197 return "none"; 219 return "none";
198 elseif access_model == "whitelist" then 220 elseif access_model == "whitelist" then
199 return "restricted"; 221 return "outcast";
200 end 222 end
201 223
202 if self.config.access_models then 224 if self.config.access_models then
203 local check = self.config.access_models[access_model]; 225 local check = self.config.access_models[access_model];
204 if check then 226 if check then