feat: Drops unused ext_events.lua.

This commit is contained in:
damencho
2024-03-27 12:18:03 -05:00
committed by Дамян Минков
parent ec423012b9
commit 79d216d91a
4 changed files with 11 additions and 67 deletions

View File

@@ -1,58 +0,0 @@
-- invite will perform the trigger for external call invites.
-- This trigger is left unimplemented. The implementation is expected
-- to be specific to the deployment.
local function invite(stanza, url, call_id)
module:log(
"warn",
"A module has been configured that triggers external events."
)
module:log("warn", "Implement this lib to trigger external events.")
end
-- cancel will perform the trigger for external call cancellation.
-- This trigger is left unimplemented. The implementation is expected
-- to be specific to the deployment.
local function cancel(stanza, url, reason, call_id)
module:log(
"warn",
"A module has been configured that triggers external events."
)
module:log("warn", "Implement this lib to trigger external events.")
end
-- missed will perform the trigger for external call missed notification.
-- This trigger is left unimplemented. The implementation is expected
-- to be specific to the deployment.
local function missed(stanza, call_id)
module:log(
"warn",
"A module has been configured that triggers external events."
)
module:log("warn", "Implement this lib to trigger external events.")
end
-- Event that speaker stats for a conference are available
-- this is a table where key is the jid and the value is a table:
--{
-- totalDominantSpeakerTime
-- nick
-- displayName
--}
-- This trigger is left unimplemented. The implementation is expected
-- to be specific to the deployment.
local function speaker_stats(room, speakerStats)
module:log(
"warn",
"A module has been configured that triggers external events."
)
module:log("warn", "Implement this lib to trigger external events.")
end
local ext_events = {
missed = missed,
invite = invite,
cancel = cancel,
speaker_stats = speaker_stats
}
return ext_events

View File

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

View File

@@ -1,4 +1,3 @@
local ext_events = module:require "ext_events"
local jid = require "util.jid"
local extract_subdomain = module:require "util".extract_subdomain;
@@ -77,13 +76,18 @@ module:hook(
local invite = function()
local url = assert(url_from_room_jid(event.stanza.attr.from))
ext_events.invite(event.stanza, url, call_id)
module:fire_event('jitsi-call-invite', { stanza = event.stanza; url = url; call_id = call_id; });
end
local cancel = function()
local url = assert(url_from_room_jid(event.stanza.attr.from))
local status = event.stanza:get_child_text("status")
ext_events.cancel(event.stanza, url, string.lower(status), call_id)
module:fire_event('jitsi-call-cancel', {
stanza = event.stanza;
url = url;
reason = string.lower(status);
call_id = call_id;
});
end
-- If for any reason call_cancel is set to true then a cancel
@@ -96,7 +100,7 @@ module:hook(
local missed = function()
cancel()
ext_events.missed(event.stanza, call_id)
module:fire_event('jitsi-call-missed', { stanza = event.stanza; call_id = call_id; });
end
-- All other call flow actions will require a status.

View File

@@ -4,7 +4,6 @@ local room_jid_match_rewrite = util.room_jid_match_rewrite;
local is_healthcheck_room = util.is_healthcheck_room;
local process_host_module = util.process_host_module;
local jid_resource = require "util.jid".resource;
local ext_events = module:require "ext_events"
local st = require "util.stanza";
local socket = require "socket";
local json = require "util.json";
@@ -314,14 +313,14 @@ function room_destroyed(event)
return;
end
ext_events.speaker_stats(room, room.speakerStats);
module:fire_event("send-speaker-stats", { room = room; roomSpeakerStats = room.speakerStats; });
end
module:hook("message/host", on_message);
function process_main_muc_loaded(main_muc, host_module)
-- the conference muc component
module:log("info", "Hook to muc events on %s", host_module);
module:log("info", "Hook to muc events on %s", host_module.host);
main_muc_service = main_muc;
module:log("info", "Main muc service %s", main_muc_service)
host_module:hook("muc-room-created", room_created, -1);
@@ -332,7 +331,7 @@ end
function process_breakout_muc_loaded(breakout_muc, host_module)
-- the Breakout muc component
module:log("info", "Hook to muc events on %s", host_module);
module:log("info", "Hook to muc events on %s", host_module.host);
host_module:hook("muc-room-created", breakout_room_created, -1);
host_module:hook("muc-occupant-joined", occupant_joined, -1);
host_module:hook("muc-occupant-pre-leave", occupant_leaving, -1);