Selaa lähdekoodia

fix(speakerstats): Filters speaker stats to not include hidden participants.

* fix(speakerstats): Filters speaker stats to not include hidden participants.

* squash: Make recorder prefixes configurable.
factor2
Дамян Минков 10 kuukautta sitten
vanhempi
commit
4e72601bee
No account linked to committer's email address

+ 7
- 4
resources/prosody-plugins/mod_speakerstats_component.lua Näytä tiedosto

@@ -1,8 +1,10 @@
1 1
 local util = module:require "util";
2 2
 local get_room_from_jid = util.get_room_from_jid;
3 3
 local room_jid_match_rewrite = util.room_jid_match_rewrite;
4
+local is_jibri = util.is_jibri;
4 5
 local is_healthcheck_room = util.is_healthcheck_room;
5 6
 local process_host_module = util.process_host_module;
7
+local is_transcriber_jigasi = util.is_transcriber_jigasi;
6 8
 local jid_resource = require "util.jid".resource;
7 9
 local st = require "util.stanza";
8 10
 local socket = require "socket";
@@ -221,14 +223,15 @@ end
221 223
 
222 224
 -- Create SpeakerStats object for the joined user
223 225
 function occupant_joined(event)
224
-    local occupant, room = event.occupant, event.room;
226
+    local occupant, room, stanza = event.occupant, event.room, event.stanza;
225 227
 
226
-    if is_healthcheck_room(room.jid) or is_admin(occupant.bare_jid) then
228
+    if is_healthcheck_room(room.jid)
229
+        or is_admin(occupant.bare_jid)
230
+        or is_transcriber_jigasi(stanza)
231
+        or is_jibri(occupant) then
227 232
         return;
228 233
     end
229 234
 
230
-    local occupant = event.occupant;
231
-
232 235
     local nick = jid_resource(occupant.nick);
233 236
 
234 237
     if room.speakerStats then

+ 7
- 0
resources/prosody-plugins/util.lib.lua Näytä tiedosto

@@ -31,6 +31,7 @@ local roomless_iqs = {};
31 31
 
32 32
 local OUTBOUND_SIP_JIBRI_PREFIXES = { 'outbound-sip-jibri@', 'sipjibriouta@', 'sipjibrioutb@' };
33 33
 local INBOUND_SIP_JIBRI_PREFIXES = { 'inbound-sip-jibri@', 'sipjibriina@', 'sipjibriina@' };
34
+local RECORDER_PREFIXES = module:get_option_inherited_set('recorder_prefixes', { 'recorder@recorder.', 'jibria@recorder.', 'jibrib@recorder.' });
34 35
 
35 36
 local split_subdomain_cache = cache.new(1000);
36 37
 local extract_subdomain_cache = cache.new(1000);
@@ -530,6 +531,10 @@ function is_sip_jibri_join(stanza)
530 531
     return false
531 532
 end
532 533
 
534
+function is_jibri(occupant)
535
+    return starts_with_one_of(occupant.jid, RECORDER_PREFIXES)
536
+end
537
+
533 538
 -- process a host module directly if loaded or hooks to wait for its load
534 539
 function process_host_module(name, callback)
535 540
     local function process_host(host)
@@ -595,8 +600,10 @@ end
595 600
 return {
596 601
     OUTBOUND_SIP_JIBRI_PREFIXES = OUTBOUND_SIP_JIBRI_PREFIXES;
597 602
     INBOUND_SIP_JIBRI_PREFIXES = INBOUND_SIP_JIBRI_PREFIXES;
603
+    RECORDER_PREFIXES = RECORDER_PREFIXES;
598 604
     extract_subdomain = extract_subdomain;
599 605
     is_feature_allowed = is_feature_allowed;
606
+    is_jibri = is_jibri;
600 607
     is_healthcheck_room = is_healthcheck_room;
601 608
     is_moderated = is_moderated;
602 609
     is_sip_jibri_join = is_sip_jibri_join;

Loading…
Peruuta
Tallenna