mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-26 03:02:25 -05:00
Add disco checking for chat states + jingle
This commit is contained in:
parent
cc40e9e574
commit
f8c946a60d
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user