Procházet zdrojové kódy

feat: Adds a couple of permanent analytics properties. (#794)

* feat: Adds a couple of permanent analytics properties.
dev1
George Politis před 6 roky
rodič
revize
520ee512af
1 změnil soubory, kde provedl 33 přidání a 0 odebrání
  1. 33
    0
      modules/xmpp/ChatRoom.js

+ 33
- 0
modules/xmpp/ChatRoom.js Zobrazit soubor

@@ -11,6 +11,7 @@ import * as MediaType from '../../service/RTC/MediaType';
11 11
 import XMPPEvents from '../../service/xmpp/XMPPEvents';
12 12
 
13 13
 import Moderator from './moderator';
14
+import Statistics from '../statistics/statistics';
14 15
 
15 16
 const logger = getLogger(__filename);
16 17
 
@@ -613,6 +614,38 @@ export default class ChatRoom extends Listenable {
613 614
                     this.eventEmitter.emit(XMPPEvents.BRIDGE_DOWN);
614 615
                 }
615 616
                 break;
617
+            case 'conference-properties':
618
+                if (member.isFocus) {
619
+                    for (let j = 0; j < node.children.length; j++) {
620
+                        const { attributes } = node.children[j];
621
+
622
+                        if (!attributes) {
623
+                            break;
624
+                        }
625
+
626
+                        const { key, value } = attributes;
627
+
628
+                        switch (key) {
629
+                        case 'octo-enabled':
630
+                            // This flag can be used to distinguish between
631
+                            // conferences and/or participants with octo
632
+                            // enabled or disabled.
633
+                            Statistics.analytics.addPermanentProperties({
634
+                                'octo_enabled': value
635
+                            });
636
+                            break;
637
+                        case 'created-ms':
638
+                            // The room creation time along with the JID can
639
+                            // be used to uniquely identify a
640
+                            // conference/user.
641
+                            Statistics.analytics.addPermanentProperties({
642
+                                'created_ms': value
643
+                            });
644
+                            break;
645
+                        }
646
+                    }
647
+                }
648
+                break;
616 649
             case 'transcription-status': {
617 650
                 const { attributes } = node;
618 651
 

Načítá se…
Zrušit
Uložit