1
0
Fork 0

send a message

master
Matthieu Lalonde 15 years ago committed by Mathieu Lecarme
parent f48d119ceb
commit 0588e020da

@ -95,6 +95,14 @@ Client.prototype._debug = function(txt) {
} }
}; };
Client.prototype.message = function(to, message) {
this.xmpp.send(new xmpp.Element('message', {
to: to,
type: 'chat'}).
c('body').
t(message));
};
Client.prototype.iq = function(iq, callback) { Client.prototype.iq = function(iq, callback) {
var n = this._iq++; var n = this._iq++;
this._iqCallback[n] = callback; this._iqCallback[n] = callback;

@ -28,6 +28,7 @@ exports.testClient = function(test) {
c.debug = true; c.debug = true;
c.addListener('online', function() { c.addListener('online', function() {
test.ok(true); test.ok(true);
c.message(conf.to, "Beuha de test!");
test.done(); test.done();
}); });
}; };

Loading…
Cancel
Save