Browse Source

ref: Make is_healthcheck_room more generic.

j8
Boris Grozev 5 years ago
parent
commit
76e1217439

+ 2
- 2
resources/prosody-plugins/mod_muc_allowners.lua View File

3
 module:hook("muc-occupant-joined", function (event)
3
 module:hook("muc-occupant-joined", function (event)
4
     local room, occupant = event.room, event.occupant;
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
         return;
7
         return;
8
     end
8
     end
9
 
9
 
13
 module:hook("muc-occupant-left", function (event)
13
 module:hook("muc-occupant-left", function (event)
14
     local room, occupant = event.room, event.occupant;
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
         return;
17
         return;
18
     end
18
     end
19
 
19
 

+ 1
- 1
resources/prosody-plugins/mod_muc_lobby_rooms.lua View File

209
     host_module:hook('muc-occupant-pre-join', function (event)
209
     host_module:hook('muc-occupant-pre-join', function (event)
210
         local room, stanza = event.room, event.stanza;
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
             return;
213
             return;
214
         end
214
         end
215
 
215
 

+ 1
- 1
resources/prosody-plugins/mod_muc_meeting_id.lua View File

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

+ 4
- 4
resources/prosody-plugins/mod_speakerstats_component.lua View File

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

+ 3
- 2
resources/prosody-plugins/util.lib.lua View File

175
 function starts_with(str, start)
175
 function starts_with(str, start)
176
     return str:sub(1, #start) == start
176
     return str:sub(1, #start) == start
177
 end
177
 end
178
+
178
 -- healthcheck rooms in jicofo starts with a string '__jicofo-health-check'
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
         return true;
182
         return true;
182
     end
183
     end
183
 
184
 

Loading…
Cancel
Save