Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat: Use room data form for conference duration.

damenchoe1ce83d0c390
diff --git a/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example b/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example
index 64bb40d2f3..49ae215d0f 100644
--- a/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example
+++ b/doc/debian/jitsi-meet-prosody/prosody.cfg.lua-jvb.example
@@ -51,7 +51,6 @@ VirtualHost "jitmeet.example.com"
}
av_moderation_component = "avmoderation.jitmeet.example.com"
speakerstats_component = "speakerstats.jitmeet.example.com"
- conference_duration_component = "conferenceduration.jitmeet.example.com"
end_conference_component = "endconference.jitmeet.example.com"
-- we need bosh
modules_enabled = {
@@ -130,9 +129,6 @@ Component "focus.jitmeet.example.com" "client_proxy"
Component "speakerstats.jitmeet.example.com" "speakerstats_component"
muc_component = "conference.jitmeet.example.com"
-Component "conferenceduration.jitmeet.example.com" "conference_duration_component"
- muc_component = "conference.jitmeet.example.com"
-
Component "endconference.jitmeet.example.com" "end_conference"
muc_component = "conference.jitmeet.example.com"
diff --git a/package-lock.json b/package-lock.json
index 41db1bda62..c06c9ab7ae 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -60,7 +60,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
- "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1767.0.0+178f9bbf/lib-jitsi-meet.tgz",
+ "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1769.0.0+ff9f57c5/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
@@ -12905,8 +12905,8 @@
},
"node_modules/lib-jitsi-meet": {
"version": "0.0.0",
- "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1767.0.0+178f9bbf/lib-jitsi-meet.tgz",
- "integrity": "sha512-fhuRtG6n1EqfcAMwXF2BMfa5pBO4lHgWRoWj4tviY8//eTrld98HbWxMkSXKUtL0B9slXlPQYn+WyjYUJ63wuQ==",
+ "resolved": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1769.0.0+ff9f57c5/lib-jitsi-meet.tgz",
+ "integrity": "sha512-3zqKShh+FMDn6JT0Ir6OML2azwF2jbM8Xw/+oBgBANyF/fb89vw0lzVm/Njs/eDuks7W3PJRuxRRIBk6FIZV3w==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
@@ -29479,8 +29479,8 @@
}
},
"lib-jitsi-meet": {
- "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1767.0.0+178f9bbf/lib-jitsi-meet.tgz",
- "integrity": "sha512-fhuRtG6n1EqfcAMwXF2BMfa5pBO4lHgWRoWj4tviY8//eTrld98HbWxMkSXKUtL0B9slXlPQYn+WyjYUJ63wuQ==",
+ "version": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1769.0.0+ff9f57c5/lib-jitsi-meet.tgz",
+ "integrity": "sha512-3zqKShh+FMDn6JT0Ir6OML2azwF2jbM8Xw/+oBgBANyF/fb89vw0lzVm/Njs/eDuks7W3PJRuxRRIBk6FIZV3w==",
"requires": {
"@jitsi/js-utils": "2.2.1",
"@jitsi/logger": "2.0.2",
diff --git a/package.json b/package.json
index f6e8393821..3be89df29d 100644
--- a/package.json
+++ b/package.json
@@ -66,7 +66,7 @@
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
"jwt-decode": "2.2.0",
- "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1767.0.0+178f9bbf/lib-jitsi-meet.tgz",
+ "lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1769.0.0+ff9f57c5/lib-jitsi-meet.tgz",
"lodash": "4.17.21",
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
diff --git a/resources/prosody-plugins/mod_conference_duration.lua b/resources/prosody-plugins/mod_conference_duration.lua
index 55868f66b4..28141e86ba 100644
--- a/resources/prosody-plugins/mod_conference_duration.lua
+++ b/resources/prosody-plugins/mod_conference_duration.lua
@@ -1,4 +1,48 @@
+local it = require "util.iterators";
+local process_host_module = module:require "util".process_host_module;
+
+local main_muc_component_config = module:get_option_string('main_muc');
+if main_muc_component_config == nil then
+ module:log('error', 'lobby not enabled missing main_muc config');
+ return ;
+end
+
+-- Returns the meeting created timestamp form data.
+function getMeetingCreatedTSConfig(room)
+ return {
+ name = "muc#roominfo_created_timestamp";
+ type = "text-single";
+ label = "The meeting created_timestamp.";
+ value = room.created_timestamp or "";
+ };
+end
+
+function occupant_joined(event)
+ local room = event.room;
+ local occupant = event.occupant;
+
+ local participant_count = it.count(room:each_occupant());
+
+ if participant_count > 1 then
+ if room.created_timestamp == nil then
+ room.created_timestamp = os.time() * 1000; -- Lua provides UTC time in seconds, so convert to milliseconds
+ end
+ end
+end
+
+process_host_module(main_muc_component_config, function(host_module, host)
+ -- add meeting Id to the disco info requests to the room
+ host_module:hook("muc-disco#info", function(event)
+ table.insert(event.form, getMeetingCreatedTSConfig(event.room));
+ end);
+
+ -- Marks the created timestamp in the room object
+ host_module:hook("muc-occupant-joined", occupant_joined, -1);
+end);
+
+-- DEPRECATED and will be removed, giving time for mobile clients to update
local conference_duration_component
= module:get_option_string("conference_duration_component", "conferenceduration."..module.host);
-
-module:add_identity("component", "conference_duration", conference_duration_component);
+if conference_duration_component then
+ module:add_identity("component", "conference_duration", conference_duration_component);
+end
diff --git a/resources/prosody-plugins/mod_conference_duration_component.lua b/resources/prosody-plugins/mod_conference_duration_component.lua
index 383d0ecab0..6d7892c2bb 100644
--- a/resources/prosody-plugins/mod_conference_duration_component.lua
+++ b/resources/prosody-plugins/mod_conference_duration_component.lua
@@ -1,8 +1,10 @@
+-- DEPRECATED and will be removed, giving time for mobile clients to update
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;
-- we use async to detect Prosody 0.10 and earlier
local have_async = pcall(require, "util.async");
@@ -26,11 +28,6 @@ function occupant_joined(event)
local participant_count = it.count(room:each_occupant());
if participant_count > 1 then
-
- if room.created_timestamp == nil then
- room.created_timestamp = os.time() * 1000; -- Lua provides UTC time in seconds, so convert to milliseconds
- end
-
local body_json = {};
body_json.type = 'conference_duration';
body_json.created_timestamp = room.created_timestamp;
@@ -46,21 +43,6 @@ function occupant_joined(event)
end
end
--- executed on every host added internally in prosody, including components
-function process_host(host)
- if host == muc_component_host then -- the conference muc component
- module:log("info", "Hook to muc events on %s", host);
-
- local muc_module = module:context(host)
- muc_module:hook("muc-occupant-joined", occupant_joined, -1);
- end
-end
-
-if prosody.hosts[muc_component_host] == nil then
- module:log("info", "No muc component found, will listen for it: %s", muc_component_host);
-
- -- when a host or component is added
- prosody.events.add_handler("host-activated", process_host);
-else
- process_host(muc_component_host);
-end
+process_host_module(muc_component_host, function(host_module, host)
+ host_module:hook("muc-occupant-joined", occupant_joined, -1);
+end);