|
@@ -1,5 +1,6 @@
|
1
|
1
|
/* global $, b64_sha1, Strophe */
|
2
|
2
|
import XMPPEvents from "../../service/xmpp/XMPPEvents";
|
|
3
|
+import Listenable from "../util/Listenable";
|
3
|
4
|
|
4
|
5
|
/**
|
5
|
6
|
* The property
|
|
@@ -19,7 +20,7 @@ function compareIdentities(a, b) {
|
19
|
20
|
/**
|
20
|
21
|
* Implements xep-0115 ( http://xmpp.org/extensions/xep-0115.html )
|
21
|
22
|
*/
|
22
|
|
-export default class Caps {
|
|
23
|
+export default class Caps extends Listenable {
|
23
|
24
|
/**
|
24
|
25
|
* Constructs new Caps instance.
|
25
|
26
|
* @param {Strophe.Connection} connection the strophe connection object
|
|
@@ -27,6 +28,7 @@ export default class Caps {
|
27
|
28
|
* that will be sent to the other participants
|
28
|
29
|
*/
|
29
|
30
|
constructor(connection = {}, node = "http://jitsi.org/jitsimeet") {
|
|
31
|
+ super();
|
30
|
32
|
this.node = node;
|
31
|
33
|
this.disco = connection.disco;
|
32
|
34
|
if(!this.disco) {
|
|
@@ -193,7 +195,12 @@ export default class Caps {
|
193
|
195
|
const caps = stanza.querySelector("c");
|
194
|
196
|
const version = caps.getAttribute("ver");
|
195
|
197
|
const node = caps.getAttribute("node");
|
|
198
|
+ const oldVersion = this.jidToVersion[from];
|
196
|
199
|
this.jidToVersion[from] = {version, node};
|
|
200
|
+ if(oldVersion && oldVersion.version !== version) {
|
|
201
|
+ this.eventEmitter.emit(XMPPEvents.PARTCIPANT_FEATURES_CHANGED,
|
|
202
|
+ from);
|
|
203
|
+ }
|
197
|
204
|
// return true to not remove the handler from Strophe
|
198
|
205
|
return true;
|
199
|
206
|
}
|