1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-22 09:12:19 -05:00

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

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;