Browse Source

fix(breakout-rooms) cleanup code

master
Saúl Ibarra Corretgé 3 years ago
parent
commit
1a93da8c35
1 changed files with 4 additions and 7 deletions
  1. 4
    7
      resources/prosody-plugins/mod_muc_breakout_rooms.lua

+ 4
- 7
resources/prosody-plugins/mod_muc_breakout_rooms.lua View File

@@ -28,17 +28,14 @@ if not have_async then
28 28
     return;
29 29
 end
30 30
 
31
-local jid_bare = require 'util.jid'.bare;
32 31
 local jid_node = require 'util.jid'.node;
33 32
 local jid_host = require 'util.jid'.host;
34
-local jid_resource = require 'util.jid'.resource;
35 33
 local jid_split = require 'util.jid'.split;
36 34
 local json = require 'util.json';
37 35
 local st = require 'util.stanza';
38 36
 local uuid_gen = require 'util.uuid'.generate;
39 37
 
40 38
 local util = module:require 'util';
41
-local get_room_from_jid = util.get_room_from_jid;
42 39
 local is_healthcheck_room = util.is_healthcheck_room;
43 40
 
44 41
 local BREAKOUT_ROOMS_IDENTITY_TYPE = 'breakout_rooms';
@@ -69,7 +66,7 @@ local main_rooms_map = {};
69 66
 -- Utility functions
70 67
 
71 68
 function get_main_room_jid(room_jid)
72
-    local node, host = jid_split(room_jid);
69
+    local _, host = jid_split(room_jid);
73 70
 
74 71
 	return
75 72
         host == main_muc_component_config
@@ -338,7 +335,7 @@ function exist_occupants_in_room(room)
338 335
     if not room then
339 336
         return false;
340 337
     end
341
-    for occupant_jid, occupant in room:each_occupant() do
338
+    for _, occupant in room:each_occupant() do
342 339
         if jid_node(occupant.jid) ~= 'focus' then
343 340
             return true;
344 341
         end
@@ -468,7 +465,7 @@ function process_breakout_rooms_muc_loaded(breakout_rooms_muc, host_module)
468 465
 
469 466
     host_module:hook("muc-config-form", function(event)
470 467
         local room = event.room;
471
-        local main_room, main_room_jid = get_main_room(room.jid);
468
+        local _, main_room_jid = get_main_room(room.jid);
472 469
 
473 470
         -- Breakout room matadata.
474 471
         table.insert(event.form, {
@@ -500,7 +497,7 @@ function process_breakout_rooms_muc_loaded(breakout_rooms_muc, host_module)
500 497
 
501 498
     -- we base affiliations (roles) in breakout rooms muc component to be based on the roles in the main muc
502 499
     room_mt.get_affiliation = function(room, jid)
503
-        local main_room, main_room_jid = get_main_room(room.jid);
500
+        local main_room, _ = get_main_room(room.jid);
504 501
 
505 502
         if not main_room then
506 503
             module:log('error', 'No main room(%s) for %s!', room.jid, jid);

Loading…
Cancel
Save