|
@@ -206,12 +206,19 @@ export default class XMPP extends Listenable {
|
206
|
206
|
identities.forEach(identity => {
|
207
|
207
|
if (identity.type === 'speakerstats') {
|
208
|
208
|
this.speakerStatsComponentAddress = identity.name;
|
|
209
|
+ }
|
209
|
210
|
|
210
|
|
- this.connection.addHandler(
|
211
|
|
- this._onPrivateMessage.bind(this), null,
|
212
|
|
- 'message', null, null);
|
|
211
|
+ if (identity.type === 'conference_duration') {
|
|
212
|
+ this.conferenceDurationComponentAddress = identity.name;
|
213
|
213
|
}
|
214
|
214
|
});
|
|
215
|
+
|
|
216
|
+ if (this.speakerStatsComponentAddress
|
|
217
|
+ || this.conferenceDurationComponentAddress) {
|
|
218
|
+ this.connection.addHandler(
|
|
219
|
+ this._onPrivateMessage.bind(this), null,
|
|
220
|
+ 'message', null, null);
|
|
221
|
+ }
|
215
|
222
|
})
|
216
|
223
|
.catch(error => {
|
217
|
224
|
const errmsg = 'Feature discovery error';
|
|
@@ -713,7 +720,7 @@ export default class XMPP extends Listenable {
|
713
|
720
|
|
714
|
721
|
/**
|
715
|
722
|
* A private message is received, message that is not addressed to the muc.
|
716
|
|
- * We expect private message coming from speaker stats component if it is
|
|
723
|
+ * We expect private message coming from plugins component if it is
|
717
|
724
|
* enabled and running.
|
718
|
725
|
*
|
719
|
726
|
* @param {string} msg - The message.
|
|
@@ -721,8 +728,8 @@ export default class XMPP extends Listenable {
|
721
|
728
|
_onPrivateMessage(msg) {
|
722
|
729
|
const from = msg.getAttribute('from');
|
723
|
730
|
|
724
|
|
- if (!this.speakerStatsComponentAddress
|
725
|
|
- || from !== this.speakerStatsComponentAddress) {
|
|
731
|
+ if (!(from === this.speakerStatsComponentAddress
|
|
732
|
+ || from === this.conferenceDurationComponentAddress)) {
|
726
|
733
|
return;
|
727
|
734
|
}
|
728
|
735
|
|
|
@@ -737,6 +744,13 @@ export default class XMPP extends Listenable {
|
737
|
744
|
XMPPEvents.SPEAKER_STATS_RECEIVED, parsedJson.users);
|
738
|
745
|
}
|
739
|
746
|
|
|
747
|
+ if (parsedJson
|
|
748
|
+ && parsedJson[JITSI_MEET_MUC_TYPE] === 'conference_duration'
|
|
749
|
+ && parsedJson.created_timestamp) {
|
|
750
|
+ this.eventEmitter.emit(
|
|
751
|
+ XMPPEvents.CONFERENCE_TIMESTAMP_RECEIVED, parsedJson.created_timestamp);
|
|
752
|
+ }
|
|
753
|
+
|
740
|
754
|
return true;
|
741
|
755
|
}
|
742
|
756
|
}
|