Преглед изворни кода

ref: Make is_healthcheck_room more generic.

j8
Boris Grozev пре 5 година
родитељ
комит
76e1217439

+ 2
- 2
resources/prosody-plugins/mod_muc_allowners.lua Прегледај датотеку

@@ -3,7 +3,7 @@ local is_healthcheck_room = module:require "util".is_healthcheck_room;
3 3
 module:hook("muc-occupant-joined", function (event)
4 4
     local room, occupant = event.room, event.occupant;
5 5
 
6
-    if is_healthcheck_room(room) then
6
+    if is_healthcheck_room(room.jid) then
7 7
         return;
8 8
     end
9 9
 
@@ -13,7 +13,7 @@ end, 2);
13 13
 module:hook("muc-occupant-left", function (event)
14 14
     local room, occupant = event.room, event.occupant;
15 15
 
16
-    if is_healthcheck_room(room) then
16
+    if is_healthcheck_room(room.jid) then
17 17
         return;
18 18
     end
19 19
 

+ 1
- 1
resources/prosody-plugins/mod_muc_lobby_rooms.lua Прегледај датотеку

@@ -209,7 +209,7 @@ process_host_module(main_muc_component_config, function(host_module, host)
209 209
     host_module:hook('muc-occupant-pre-join', function (event)
210 210
         local room, stanza = event.room, event.stanza;
211 211
 
212
-        if is_healthcheck_room(room) then
212
+        if is_healthcheck_room(room.jid) then
213 213
             return;
214 214
         end
215 215
 

+ 1
- 1
resources/prosody-plugins/mod_muc_meeting_id.lua Прегледај датотеку

@@ -9,7 +9,7 @@ local is_healthcheck_room = module:require "util".is_healthcheck_room;
9 9
 module:hook("muc-room-created", function(event)
10 10
     local room = event.room;
11 11
 
12
-    if is_healthcheck_room(room) then
12
+    if is_healthcheck_room(room.jid) then
13 13
         return;
14 14
     end
15 15
 

+ 4
- 4
resources/prosody-plugins/mod_speakerstats_component.lua Прегледај датотеку

@@ -113,7 +113,7 @@ end
113 113
 function room_created(event)
114 114
     local room = event.room;
115 115
 
116
-    if is_healthcheck_room(room) then
116
+    if is_healthcheck_room(room.jid) then
117 117
         return;
118 118
     end
119 119
 
@@ -124,7 +124,7 @@ end
124 124
 function occupant_joined(event)
125 125
     local room = event.room;
126 126
 
127
-    if is_healthcheck_room(room) then
127
+    if is_healthcheck_room(room.jid) then
128 128
         return;
129 129
     end
130 130
 
@@ -184,7 +184,7 @@ end
184 184
 function occupant_leaving(event)
185 185
     local room = event.room;
186 186
 
187
-    if is_healthcheck_room(room) then
187
+    if is_healthcheck_room(room.jid) then
188 188
         return;
189 189
     end
190 190
 
@@ -205,7 +205,7 @@ end
205 205
 function room_destroyed(event)
206 206
     local room = event.room;
207 207
 
208
-    if is_healthcheck_room(room) then
208
+    if is_healthcheck_room(room.jid) then
209 209
         return;
210 210
     end
211 211
 

+ 3
- 2
resources/prosody-plugins/util.lib.lua Прегледај датотеку

@@ -175,9 +175,10 @@ end
175 175
 function starts_with(str, start)
176 176
     return str:sub(1, #start) == start
177 177
 end
178
+
178 179
 -- healthcheck rooms in jicofo starts with a string '__jicofo-health-check'
179
-function is_healthcheck_room(room)
180
-    if starts_with(room.jid, "__jicofo-health-check") then
180
+function is_healthcheck_room(room_jid)
181
+    if starts_with(room_jid, "__jicofo-health-check") then
181 182
         return true;
182 183
     end
183 184
 

Loading…
Откажи
Сачувај