|
|
|
@ -65,7 +65,7 @@ Client.prototype.getRoster = function(callback) {
|
|
|
|
|
/*
|
|
|
|
|
http://xmpp.org/extensions/xep-0092.html
|
|
|
|
|
*/
|
|
|
|
|
Client.prototype.getVersion = function(jid, callback, error) {
|
|
|
|
|
Client.prototype.getVersion = function(jid, success, error) {
|
|
|
|
|
var jabber = this;
|
|
|
|
|
this.iq(jid, new xmpp.Element('query', {xmlns: 'jabber:iq:version'}), function(iq) {
|
|
|
|
|
var v = iq.getChild('query', 'jabber:iq:version');
|
|
|
|
@ -74,10 +74,24 @@ Client.prototype.getVersion = function(jid, callback, error) {
|
|
|
|
|
version: v.getChildText('version'),
|
|
|
|
|
os: v.getChildText('os')
|
|
|
|
|
};
|
|
|
|
|
callback.call(jabber, version);
|
|
|
|
|
success.call(jabber, version);
|
|
|
|
|
}, error);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
http://xmpp.org/extensions/xep-0012.html
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
Client.prototype.getLast = function(jid, success, error) {
|
|
|
|
|
var jabber = this;
|
|
|
|
|
this.iq(jid, new xmpp.Element('query', {xmlns: 'jabber:iq:last'}),
|
|
|
|
|
function(iq) {
|
|
|
|
|
success.call(jabber, parseInt(iq.getChild('query', 'jabber:iq:last').attrs.seconds, 10));
|
|
|
|
|
},
|
|
|
|
|
error
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Client.prototype.disconnect = function() {
|
|
|
|
|
this.xmpp.send(new xmpp.Element('presence', {type: 'unavailable'})
|
|
|
|
|
.c('status').t('Logged out')
|
|
|
|
|