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

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