Permalink
Browse files

cleanup

  • Loading branch information...
Joachim Kainz
Joachim Kainz committed May 4, 2012
1 parent 910a2f0 commit 7ce7cc64ac57f808b77235d7b1f34767d9b8687c
Showing with 14 additions and 13 deletions.
  1. +1 −1 examples/room.js
  2. +8 −7 lib/debug.js
  3. +5 −5 lib/simple-xmpp.js
@@ -28,7 +28,7 @@
});
client.on('stanza', function (stanza) {
console.log("stanza: %j", stanza);
// console.log("stanza: %j", stanza);
});
client.on('chat', function (from, message) {
@@ -2,6 +2,10 @@
(function (module) {
"use strict";
var debug = process.env.NODE_DEBUG && /simpler-xmpp/.test(process.env.NODE_DEBUG),
util = require('util'),
logger;
function formatMessage() {
var args = Array.prototype.slice.call(arguments),
first = args.shift();
@@ -12,14 +16,11 @@
return util.format.apply(this, args);
}
var debug = process.env.NODE_DEBUG && /simpler-xmpp/.test(process.env.NODE_DEBUG),
util = require('util'),
logger = debug ?
function () {
var message = formatMessage.apply(this, arguments);
logger = debug ? function () {
var message = formatMessage.apply(this, arguments);
console.error(message);
} : function () {
console.error(message);
} : function () {
};
logger.debug = debug;
@@ -312,24 +312,24 @@
return sendMessage(hidden, stanza);
};
this.discoverRoom = function (jid) {
var stanza = new xmpp.Message({
/*
var stanza = new xmpp.Message({
to:jid
}),
body = stanza.c('x', {xmlns:'jabber:x:data', type: 'submit'});
body.c('field', { var: 'FORM_TYPE'}).c('value').t('http://jabber.org/protocol/muc#request');
body.c('field', { var: 'muc#role', type: 'text-single', label: 'Requested role'}).c('value').t('participant');
/*
var stanza = new xmpp.Iq({
to:jid,
type:'get'
});
stanza.c('query', {xmlns:'http://jabber.org/protocol/disco#info', node: 'x-roomuser-item'});
var stanza = new xmpp.Presence({
to:jid
});
*/
var stanza = new xmpp.Presence({
to:jid
});
return sendMessage(hidden, stanza);
}
}

0 comments on commit 7ce7cc6

Please sign in to comment.