comparison modules/http/mod_atom.js @ 41:bc717575e66a

Much better handling of modules.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 20 Feb 2011 15:51:12 +0100
parents 62cbb1c49bc5
children 023f767662d3
comparison
equal deleted inserted replaced
40:741110cdcfcf 41:bc717575e66a
1 var config = require('../../configuration');
2 var storage = require('../../storage');
3 var forms = require('../../forms');
4 var errors = require('../../errors');
5 var makeError = errors.makeError;
6 var NS = require('../../namespaces');
7 var xmpp = require('xmpp');
8
9 exports.atom = { 1 exports.atom = {
10 url: /^\/atom/, 2 url: /^\/atom/,
11 func: function (req, res) { 3 func: function (req, res) {
12 var url = require('url').parse(req.url); 4 var url = require('url').parse(req.url);
13 nodeID = url.pathname.substr(url.pathname.indexOf('/', 1)+1); 5 nodeID = url.pathname.substr(url.pathname.indexOf('/', 1)+1);
26 if (md['pubsub#title']) 18 if (md['pubsub#title'])
27 response.c('title').t(md['pubsub#title']).up(); 19 response.c('title').t(md['pubsub#title']).up();
28 if (md['pubsub#description']) 20 if (md['pubsub#description'])
29 response.c('subtitle').t(md['pubsub#description']).up(); 21 response.c('subtitle').t(md['pubsub#description']).up();
30 if (md['pubsub#creation_date']) 22 if (md['pubsub#creation_date'])
31 response.c('published').t(md['pubsub#creation_date']).up(); 23 response.c('published').t(md['pubsub#creation_date'].toString()).up();
32 24
33 children = storage.getItems(nodeID); 25 children = storage.getItems(nodeID);
34 if (typeof children == 'number') 26 if (typeof children == 'number')
35 return false; 27 return false;
36 28