Add disco checking for chat states + jingle

This commit is contained in:
Lance Stout 2013-10-14 14:04:04 -07:00
parent cc40e9e574
commit f8c946a60d
1 changed files with 34 additions and 0 deletions

View File

@ -17,6 +17,40 @@ module.exports = HumanModel.define({
discoInfo: 'object',
timezoneOffset: 'number'
},
derived: {
supportsChatStates: {
deps: ['discoInfo'],
fn: function () {
if (!this.discoInfo) return false;
var features = this.discoInfo.features;
return features.indexOf('http://jabber.org/protocol/chatstate') >= 0;
}
},
supportsJingleMedia: {
deps: ['discoInfo'],
fn: function () {
if (!this.discoInfo) return false;
var features = this.discoInfo.features;
if (features.indexOf('urn:xmpp:jingle:1') === -1) {
return false;
}
if (features.indexOf('urn:xmpp:jingle:apps:rtp:1') === -1) {
return false;
}
if (features.indexOf('urn:xmpp:jingle:apps:rtp:audio') === -1) {
return false;
}
if (features.indexOf('urn:xmpp:jingle:apps:rtp:video') === -1) {
return false;
}
return true;
}
}
},
fetchTimezone: function () {
var self = this;