Your ROOT_URL in app.ini is unix://git.lalonde.me:3000/ but you are visiting https://git.lalonde.me/matth/node-xmpp-client/commit/5da3ec3a1740246f77adf04393a10afe18b23a49?style=unified&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
7 additions and
1 deletions
@ -25,6 +25,7 @@ var Client = function(_jid, password, host) {
this . rooms = { } ;
this . _iq = 0 ;
this . _iqCallback = { } ;
this . presences = { } ;
this . roster = { } ;
this . xmpp = new xmpp . Client ( {
host : this . host ,
@ -57,7 +58,7 @@ var Client = function(_jid, password, host) {
if ( fromm [ 1 ] == 'conference.' + this . jid . domain ) {
jabber . rooms [ fromm [ 0 ] ] . emit ( 'presence' , stanza ) ;
} else {
jabber . emit ( 'presence' , stanza );
jabber . emit ( 'presence' , stanza .attrs . from , stanza );
}
}
if ( stanza . name == 'message' ) {
@ -85,6 +86,9 @@ var Client = function(_jid, password, host) {
this . addListener ( 'iqResult' , function ( id , stanza ) {
jabber . _iqCallback [ id ] . call ( jabber , stanza ) ;
} ) ;
this . addListener ( 'presence' , function ( from , stanza ) {
jabber . presences [ from ] = stanza . attrs . type ;
} ) ;
} ;
sys . inherits ( Client , events . EventEmitter ) ;
@ -38,6 +38,8 @@ exports.testClient = function(test) {
var a = new Client ( conf . a . jid , conf . a . password ) ;
a . addListener ( 'online' , function ( ) {
sys . debug ( 'a is connected' . green ) ;
sys . debug ( 'a presences : ' + JSON . stringify ( a . presences ) . green ) ;
// test.equals('available', a.presences['' + b.jid]);
test . ok ( true ) ;
a . message ( conf . b . jid , MESSAGE ) ;
} ) ;