浏览代码

feat: Drops unused ext_events.lua.

factor2
damencho 1年前
父节点
当前提交
79d216d91a

+ 0
- 42
resources/prosody-plugins/ext_events.lib.lua 查看文件

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 查看文件

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

+ 8
- 4
resources/prosody-plugins/mod_muc_call.lua 查看文件

1
-local ext_events = module:require "ext_events"
2
 local jid = require "util.jid"
1
 local jid = require "util.jid"
3
 local extract_subdomain = module:require "util".extract_subdomain;
2
 local extract_subdomain = module:require "util".extract_subdomain;
4
 
3
 
77
 
76
 
78
         local invite = function()
77
         local invite = function()
79
             local url = assert(url_from_room_jid(event.stanza.attr.from))
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
         end
80
         end
82
 
81
 
83
         local cancel = function()
82
         local cancel = function()
84
             local url = assert(url_from_room_jid(event.stanza.attr.from))
83
             local url = assert(url_from_room_jid(event.stanza.attr.from))
85
             local status = event.stanza:get_child_text("status")
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
         end
91
         end
88
 
92
 
89
         -- If for any reason call_cancel is set to true then a cancel
93
         -- If for any reason call_cancel is set to true then a cancel
96
 
100
 
97
         local missed = function()
101
         local missed = function()
98
             cancel()
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
         end
104
         end
101
 
105
 
102
         -- All other call flow actions will require a status.
106
         -- All other call flow actions will require a status.

+ 3
- 4
resources/prosody-plugins/mod_speakerstats_component.lua 查看文件

4
 local is_healthcheck_room = util.is_healthcheck_room;
4
 local is_healthcheck_room = util.is_healthcheck_room;
5
 local process_host_module = util.process_host_module;
5
 local process_host_module = util.process_host_module;
6
 local jid_resource = require "util.jid".resource;
6
 local jid_resource = require "util.jid".resource;
7
-local ext_events = module:require "ext_events"
8
 local st = require "util.stanza";
7
 local st = require "util.stanza";
9
 local socket = require "socket";
8
 local socket = require "socket";
10
 local json = require "util.json";
9
 local json = require "util.json";
314
         return;
313
         return;
315
     end
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
 end
317
 end
319
 
318
 
320
 module:hook("message/host", on_message);
319
 module:hook("message/host", on_message);
321
 
320
 
322
 function process_main_muc_loaded(main_muc, host_module)
321
 function process_main_muc_loaded(main_muc, host_module)
323
     -- the conference muc component
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
     main_muc_service = main_muc;
324
     main_muc_service = main_muc;
326
     module:log("info", "Main muc service %s", main_muc_service)
325
     module:log("info", "Main muc service %s", main_muc_service)
327
     host_module:hook("muc-room-created", room_created, -1);
326
     host_module:hook("muc-room-created", room_created, -1);
332
 
331
 
333
 function process_breakout_muc_loaded(breakout_muc, host_module)
332
 function process_breakout_muc_loaded(breakout_muc, host_module)
334
     -- the Breakout muc component
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
     host_module:hook("muc-room-created", breakout_room_created, -1);
335
     host_module:hook("muc-room-created", breakout_room_created, -1);
337
     host_module:hook("muc-occupant-joined", occupant_joined, -1);
336
     host_module:hook("muc-occupant-joined", occupant_joined, -1);
338
     host_module:hook("muc-occupant-pre-leave", occupant_leaving, -1);
337
     host_module:hook("muc-occupant-pre-leave", occupant_leaving, -1);

正在加载...
取消
保存