|
|
@ -1,5 +1,6 @@
|
|
|
|
var sys = require('sys'),
|
|
|
|
var sys = require('sys'),
|
|
|
|
colors = require('colors'),
|
|
|
|
colors = require('colors'),
|
|
|
|
|
|
|
|
xmpp = require('node-xmpp'),
|
|
|
|
Client = require('../lib/xmpp-client').Client,
|
|
|
|
Client = require('../lib/xmpp-client').Client,
|
|
|
|
JID = require('node-xmpp').JID,
|
|
|
|
JID = require('node-xmpp').JID,
|
|
|
|
conf = require('./conf').conf;
|
|
|
|
conf = require('./conf').conf;
|
|
|
@ -86,15 +87,16 @@ exports.testPubSub = function(test) {
|
|
|
|
var b = new Client(conf.b, function() {
|
|
|
|
var b = new Client(conf.b, function() {
|
|
|
|
sys.debug('b is connected'.red);
|
|
|
|
sys.debug('b is connected'.red);
|
|
|
|
this.addListener('iq:error', function(id, stanza) {
|
|
|
|
this.addListener('iq:error', function(id, stanza) {
|
|
|
|
sys.debug(stanza.toString().yellow);
|
|
|
|
sys.error(stanza.toString().red);
|
|
|
|
test.done();
|
|
|
|
test.done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
var p = b.pubsub();
|
|
|
|
var p = b.pubsub();
|
|
|
|
p.node(POEMS, function() {
|
|
|
|
p.node(POEMS, function() {
|
|
|
|
sys.debug('got my node'.yellow);
|
|
|
|
sys.debug('got my node'.yellow);
|
|
|
|
p.suscribe(POEMS, function(item) {
|
|
|
|
p.publish(POEMS, new xmpp.Element('entry', {xmlns: 'http://www.w3.org/2005/Atom'}).c('title').t('blab blah').tree());
|
|
|
|
sys.debug(item.toString().yellow);
|
|
|
|
/*p.suscribe(POEMS, function(item) {
|
|
|
|
});
|
|
|
|
sys.debug('SUSCRIBE : ' + item.toString().yellow);
|
|
|
|
|
|
|
|
});*/
|
|
|
|
//test.done();
|
|
|
|
//test.done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|