Browse Source

fix: Fix speakerstats reports.

j8
Дамян Минков 3 years ago
parent
commit
4075e5deb7
1 changed files with 12 additions and 14 deletions
  1. 12
    14
      resources/prosody-plugins/mod_speakerstats_component.lua

+ 12
- 14
resources/prosody-plugins/mod_speakerstats_component.lua View File

@@ -166,21 +166,19 @@ function occupant_joined(event)
166 166
                 end
167 167
             end
168 168
 
169
-            if next(users_json) == nil then
170
-                return;
169
+            if next(users_json) ~= nil then
170
+                local body_json = {};
171
+                body_json.type = 'speakerstats';
172
+                body_json.users = users_json;
173
+
174
+                local stanza = st.message({
175
+                    from = module.host;
176
+                    to = occupant.jid; })
177
+                :tag("json-message", {xmlns='http://jitsi.org/jitmeet'})
178
+                :text(json.encode(body_json)):up();
179
+
180
+                room:route_stanza(stanza);
171 181
             end
172
-
173
-            local body_json = {};
174
-            body_json.type = 'speakerstats';
175
-            body_json.users = users_json;
176
-
177
-            local stanza = st.message({
178
-                from = module.host;
179
-                to = occupant.jid; })
180
-            :tag("json-message", {xmlns='http://jitsi.org/jitmeet'})
181
-            :text(json.encode(body_json)):up();
182
-
183
-            room:route_stanza(stanza);
184 182
         end
185 183
 
186 184
         local context_user = event.origin and event.origin.jitsi_meet_context_user or nil;

Loading…
Cancel
Save