Mercurial > psgxs
annotate modules/mod_disco.js @ 56:99bd1d1ac071
Migration to node-xmpp, done!
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 10 Aug 2011 15:11:22 -0700 |
parents | 296de54c1c4b |
children | addbf6bbfaa8 |
rev | line source |
---|---|
43
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
1 /* |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
2 * Copyright (C) 2010 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
3 * |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
4 * This file is part of PSĜS, a PubSub server written in JavaScript. |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
5 * |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
6 * PSĜS is free software: you can redistribute it and/or modify |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
7 * it under the terms of the GNU Affero General Public License as |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
8 * published by the Free Software Foundation, either version 3 of the |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
9 * License. |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
10 * |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
11 * PSĜS is distributed in the hope that it will be useful, |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
14 * GNU Affero General Public License for more details. |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
15 * |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
16 * You should have received a copy of the GNU Affero General Public License |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
17 * along with PSĜS. If not, see <http://www.gnu.org/licenses/>. |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
18 */ |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
19 |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
20 'use strict'; |
023f767662d3
Fix compatibility with strict mode of node 0.4 and some files without licence header.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
42
diff
changeset
|
21 |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
22 // SECTION 5.1: Discover Features |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
23 exports.disco_info = { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
24 type: 'get', |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
25 child: 'query', |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
26 ns: NS.DISCO_INFO, |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
27 func: function(response, stanza, request) { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
28 var nodeID = request.getAttribute('node'); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
29 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
30 // SECTION 5.3: Discover Node Information |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
31 if (nodeID && nodeID != '') { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
32 if (!storage.existsNode(nodeID)) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
33 return makeError(response, errors.node_does_not_exist.n); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
34 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
35 var conf = storage.getConfiguration(nodeID); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
36 if (typeof conf == 'number') |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
37 return makeError(response, conf); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
38 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
39 var type = 'leaf' |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
40 if (conf['pubsub#node_type']) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
41 type = conf['pubsub#node_type']; |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
42 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
43 response.c('query', {xmlns: NS.DISCO_INFO, node: nodeID}) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
44 .c('identity', {category: 'pubsub', type: type}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
45 .c('feature', {'var': NS.PUBSUB}).up(); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
46 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
47 // SECTION 5.4 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
48 if (config.enabled('meta-data')) { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
49 var x = forms.build('result', 'node_metadata', storage.getMetadata(nodeID), true); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
50 if (x) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
51 response.cnode(x); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
52 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
53 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
54 // SECTION 5.1: Discover Features |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
55 } else { |
56
99bd1d1ac071
Migration to node-xmpp, done!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
52
diff
changeset
|
56 var query = new Element('query', {xmlns: NS.DISCO_INFO}) |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
57 .c('identity', {category: 'pubsub', type: 'service', name: 'PubSub JavaScript Server'}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
58 .c('feature', {'var': NS.DISCO_INFO}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
59 .c('feature', {'var': NS.DISCO_ITEMS}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
60 .c('feature', {'var': NS.PUBSUB}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
61 .c('feature', {'var': 'jabber:iq:version'}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
62 .c('feature', {'var': NS.COMMANDS}).up(); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
63 |
56
99bd1d1ac071
Migration to node-xmpp, done!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
52
diff
changeset
|
64 response.cnode(query); |
99bd1d1ac071
Migration to node-xmpp, done!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
52
diff
changeset
|
65 |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
66 for (var i in config.activated) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
67 if (typeof i == 'string') |
56
99bd1d1ac071
Migration to node-xmpp, done!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
52
diff
changeset
|
68 query.c('feature', {'var': 'http://jabber.org/protocol/pubsub#' + config.activated[i]}).up(); |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
69 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
70 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
71 return response; |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
72 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
73 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
74 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
75 // SECTION 5.2: Discover Nodes |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
76 exports.disco_items = { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
77 type: 'get', |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
78 child: 'query', |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
79 ns: NS.DISCO_ITEMS, |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
80 func: function(response, stanza, request, to) { |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
81 var children; |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
82 var nodeID = request.getAttribute('node'); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
83 if (nodeID && nodeID != '') { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
84 if (nodeID == NS.COMMANDS) { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
85 // XEP-0050: Ad-Hoc Commands |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
86 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
87 response.c('query', {xmlns: NS.DISCO_ITEMS, node: nodeID}) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
88 .c('item', {jid: config.jid, node: 'ping', name: 'Ping'}).up() |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
89 .c('item', {jid: config.jid, node: 'reload', name: 'Reload'}).up(); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
90 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
91 return response; |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
92 } else { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
93 if (!storage.existsNode(nodeID)) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
94 return makeError(response, errors.node_does_not_exist.n); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
95 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
96 response.c('query', {xmlns: NS.DISCO_ITEMS, node: nodeID}); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
97 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
98 children = storage.getChildren(nodeID); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
99 if (typeof children == 'number') |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
100 return makeError(response, children); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
101 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
102 } else { |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
103 response.c('query', {xmlns: NS.DISCO_ITEMS}); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
104 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
105 children = storage.getChildren(); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
106 if (typeof children == 'number') |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
107 return makeError(response, children); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
108 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
109 |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
110 for (var nodeID in children) { |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
111 var attr = {jid: config.jid}; |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
112 if (children[nodeID] == 'node') { |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
113 if (config.enabled('meta-data')) { |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
114 var metadata = storage.getMetadata(nodeID); |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
115 if (metadata['pubsub#title']) |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
116 attr.name = metadata['pubsub#title']; |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
117 |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
118 if (config.hideNonAccessibleNodes) { |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
119 var configuration = storage.getConfiguration(nodeID); |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
120 if (configuration['pubsub#access_model'] == 'whitelist') { |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
121 var affils = storage.getAffiliationsFromNodeID(nodeID); |
47
0d3f18bb1d36
Remove usage of fdsq.js in modules.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
43
diff
changeset
|
122 var affil = affils[JID.toBare(to)]; |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
123 if (!affil || affil == 'outcast') |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
124 continue; |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
125 } |
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
126 } |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
127 } |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
128 attr.node = nodeID; |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
129 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
130 // SECTION 5.5: Discover Items for a Node |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
131 } else |
42
07ca0263a53f
Add an option to hide non-accessible nodes.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
41
diff
changeset
|
132 attr.name = nodeID; |
24
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
133 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
134 response.c('item', attr).up(); |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
135 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
136 |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
137 return response; |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
138 } |
b80ab94da447
Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
139 } |