Quellcode durchsuchen

feat: Drops unused ext_events.lua.

factor2
damencho vor 1 Jahr
Ursprung
Commit
79d216d91a

+ 0
- 42
resources/prosody-plugins/ext_events.lib.lua Datei anzeigen

@@ -1,58 +0,0 @@
1
-local function invite(stanza, url, call_id)
2
-    module:log(
3
-        "warn",
4
-        "A module has been configured that triggers external events."
5
-    )
6
-    module:log("warn", "Implement this lib to trigger external events.")
7
-end
8
-
9
-local function cancel(stanza, url, reason, call_id)
10
-    module:log(
11
-        "warn",
12
-        "A module has been configured that triggers external events."
13
-    )
14
-    module:log("warn", "Implement this lib to trigger external events.")
15
-end
16
-
17
-local function missed(stanza, call_id)
18
-    module:log(
19
-        "warn",
20
-        "A module has been configured that triggers external events."
21
-    )
22
-    module:log("warn", "Implement this lib to trigger external events.")
23
-end
24
-
25
---{
26
---}
27
-local function speaker_stats(room, speakerStats)
28
-    module:log(
29
-        "warn",
30
-        "A module has been configured that triggers external events."
31
-    )
32
-    module:log("warn", "Implement this lib to trigger external events.")
33
-end
34
-
35
-local ext_events = {
36
-    missed = missed,
37
-    invite = invite,
38
-    cancel = cancel,
39
-    speaker_stats = speaker_stats
40
-}
41
-
42
-return ext_events

+ 0
- 1
resources/prosody-plugins/mod_conference_duration_component.lua Datei anzeigen

@@ -2,7 +2,6 @@
2 2
 local st = require "util.stanza";
3 3
 local socket = require "socket";
4 4
 local json = require "util.json";
5
-local ext_events = module:require "ext_events";
6 5
 local it = require "util.iterators";
7 6
 local process_host_module = module:require "util".process_host_module;
8 7
 

+ 8
- 4
resources/prosody-plugins/mod_muc_call.lua Datei anzeigen

@@ -1,4 +1,3 @@
1
-local ext_events = module:require "ext_events"
2 1
 local jid = require "util.jid"
3 2
 local extract_subdomain = module:require "util".extract_subdomain;
4 3
 
@@ -77,13 +76,18 @@ module:hook(
77 76
 
78 77
         local invite = function()
79 78
             local url = assert(url_from_room_jid(event.stanza.attr.from))
80
-            ext_events.invite(event.stanza, url, call_id)
79
+            module:fire_event('jitsi-call-invite', { stanza = event.stanza; url = url; call_id = call_id; });
81 80
         end
82 81
 
83 82
         local cancel = function()
84 83
             local url = assert(url_from_room_jid(event.stanza.attr.from))
85 84
             local status = event.stanza:get_child_text("status")
86
-            ext_events.cancel(event.stanza, url, string.lower(status), call_id)
85
+            module:fire_event('jitsi-call-cancel', {
86
+                stanza = event.stanza;
87
+                url = url;
88
+                reason = string.lower(status);
89
+                call_id = call_id;
90
+            });
87 91
         end
88 92
 
89 93
         -- If for any reason call_cancel is set to true then a cancel
@@ -96,7 +100,7 @@ module:hook(
96 100
 
97 101
         local missed = function()
98 102
             cancel()
99
-            ext_events.missed(event.stanza, call_id)
103
+            module:fire_event('jitsi-call-missed', { stanza = event.stanza; call_id = call_id; });
100 104
         end
101 105
 
102 106
         -- All other call flow actions will require a status.

+ 3
- 4
resources/prosody-plugins/mod_speakerstats_component.lua Datei anzeigen

@@ -4,7 +4,6 @@ local room_jid_match_rewrite = util.room_jid_match_rewrite;
4 4
 local is_healthcheck_room = util.is_healthcheck_room;
5 5
 local process_host_module = util.process_host_module;
6 6
 local jid_resource = require "util.jid".resource;
7
-local ext_events = module:require "ext_events"
8 7
 local st = require "util.stanza";
9 8
 local socket = require "socket";
10 9
 local json = require "util.json";
@@ -314,14 +313,14 @@ function room_destroyed(event)
314 313
         return;
315 314
     end
316 315
 
317
-    ext_events.speaker_stats(room, room.speakerStats);
316
+    module:fire_event("send-speaker-stats", { room = room; roomSpeakerStats = room.speakerStats; });
318 317
 end
319 318
 
320 319
 module:hook("message/host", on_message);
321 320
 
322 321
 function process_main_muc_loaded(main_muc, host_module)
323 322
     -- the conference muc component
324
-    module:log("info", "Hook to muc events on %s", host_module);
323
+    module:log("info", "Hook to muc events on %s", host_module.host);
325 324
     main_muc_service = main_muc;
326 325
     module:log("info", "Main muc service %s", main_muc_service)
327 326
     host_module:hook("muc-room-created", room_created, -1);
@@ -332,7 +331,7 @@ end
332 331
 
333 332
 function process_breakout_muc_loaded(breakout_muc, host_module)
334 333
     -- the Breakout muc component
335
-    module:log("info", "Hook to muc events on %s", host_module);
334
+    module:log("info", "Hook to muc events on %s", host_module.host);
336 335
     host_module:hook("muc-room-created", breakout_room_created, -1);
337 336
     host_module:hook("muc-occupant-joined", occupant_joined, -1);
338 337
     host_module:hook("muc-occupant-pre-leave", occupant_leaving, -1);

Laden…
Abbrechen
Speichern