1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
535 B

14 years ago
var sys = require('sys'),
xmpp = require('xmpp'),
events = require('events');
14 years ago
var Jid = function(plain) {
14 years ago
var tmp = plain.split('/');
14 years ago
this.resource = (tmp.length == 1) ? null : tmp[1];
14 years ago
tmp = tmp[0].split('@');
14 years ago
this.node = tmp[0];
this.domain = tmp[1];
14 years ago
};
14 years ago
exports.Jid = Jid;
14 years ago
14 years ago
var Client = function(_jid, password, host) {
14 years ago
events.EventEmitter.call(this);
var jabber = this;
14 years ago
this.jid = new Jid(_jid);
this.host = (host == null) ? this.jid.domain : host;
14 years ago
};
sys.inherits(Client, events.EventEmitter);
exports.Client = Client;