Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. local it = require "util.iterators";
  2. local process_host_module = module:require "util".process_host_module;
  3. local main_muc_component_config = module:get_option_string('main_muc');
  4. if main_muc_component_config == nil then
  5. module:log('error', 'lobby not enabled missing main_muc config');
  6. return ;
  7. end
  8. -- Returns the meeting created timestamp form data.
  9. function getMeetingCreatedTSConfig(room)
  10. return {
  11. name = "muc#roominfo_created_timestamp";
  12. type = "text-single";
  13. label = "The meeting created_timestamp.";
  14. value = room.created_timestamp or "";
  15. };
  16. end
  17. function occupant_joined(event)
  18. local room = event.room;
  19. local occupant = event.occupant;
  20. local participant_count = it.count(room:each_occupant());
  21. if participant_count > 1 then
  22. if room.created_timestamp == nil then
  23. room.created_timestamp = string.format('%i', os.time() * 1000); -- Lua provides UTC time in seconds, so convert to milliseconds
  24. end
  25. end
  26. end
  27. process_host_module(main_muc_component_config, function(host_module, host)
  28. -- add meeting Id to the disco info requests to the room
  29. host_module:hook("muc-disco#info", function(event)
  30. table.insert(event.form, getMeetingCreatedTSConfig(event.room));
  31. end);
  32. -- Marks the created timestamp in the room object
  33. host_module:hook("muc-occupant-joined", occupant_joined, -1);
  34. end);
  35. -- DEPRECATED and will be removed, giving time for mobile clients to update
  36. local conference_duration_component
  37. = module:get_option_string("conference_duration_component", "conferenceduration."..module.host);
  38. if conference_duration_component then
  39. module:add_identity("component", "conference_duration", conference_duration_component);
  40. end