Compare commits

..

1 Commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
d2521bc67a feat(android) bump minimum API level to 24
Some of our dependencies (most notably WebRTC) have dropped it and we
can no longer claim to support API level 23).
2023-05-01 11:06:44 +02:00
10 changed files with 49 additions and 206 deletions

View File

@@ -19,7 +19,7 @@ buildscript {
ext {
buildToolsVersion = "31.0.0"
compileSdkVersion = 32
minSdkVersion = 23
minSdkVersion = 24
targetSdkVersion = 32
supportLibVersion = "28.0.0"

View File

@@ -74,6 +74,10 @@
a:active {
color: black;
}
&::-webkit-scrollbar-corner {
background: #3a3a3a;
}
}

View File

@@ -43,7 +43,7 @@ export default class ToolboxItem extends AbstractToolboxItem<IProps> {
* @returns {void}
*/
_onKeyPress(event?: React.KeyboardEvent) {
if (event?.key === 'Enter') {
if (event?.key === 'Enter' || event?.key === ' ') {
event.preventDefault();
this.props.onClick();
}

View File

@@ -70,7 +70,7 @@ const useStyles = makeStyles()(theme => {
'& input[type="checkbox"]': {
appearance: 'none',
backgroundColor: 'transparent',
margin: '3px',
margin: 0,
font: 'inherit',
color: theme.palette.icon03,
width: '18px',

View File

@@ -23,21 +23,17 @@ interface IProps extends AbstractProps {
const styles = (theme: Theme) => {
return {
chatMessageWrapper: {
maxWidth: '100%',
'&.remote': {
maxWidth: 'calc(100% - 40px)' // 100% - avatar and margin
}
maxWidth: '100%'
},
chatMessage: {
display: 'inline-flex',
padding: '12px',
marginRight: '12px',
backgroundColor: theme.palette.ui02,
borderRadius: '4px 12px 12px 12px',
maxWidth: '100%',
marginTop: '4px',
boxSizing: 'border-box' as const,
'&.privatemessage': {
backgroundColor: theme.palette.support05
@@ -66,8 +62,7 @@ const styles = (theme: Theme) => {
replyWrapper: {
display: 'flex',
flexDirection: 'row' as const,
alignItems: 'center',
maxWidth: '100%'
alignItems: 'center'
},
messageContent: {
@@ -131,7 +126,7 @@ class ChatMessage extends AbstractChatMessage<IProps> {
return (
<div
className = { clsx(classes.chatMessageWrapper, type) }
className = { classes.chatMessageWrapper }
id = { this.props.message.messageId }
tabIndex = { -1 }>
<div

View File

@@ -28,13 +28,6 @@ const useStyles = makeStyles()(theme => {
color: theme.palette.text01
},
text: {
maxWidth: 'calc(100% - 30px)',
overflow: 'hidden',
whiteSpace: 'break-spaces',
wordBreak: 'break-all'
},
iconButton: {
padding: '2px',
@@ -79,7 +72,7 @@ const MessageRecipient = ({
className = { classes.container }
id = 'chat-recipient'
role = 'alert'>
<span className = { classes.text }>
<span>
{t(_isLobbyChatActive ? 'chat.lobbyChatMessageTo' : 'chat.messageTo', {
recipient: _isLobbyChatActive ? _lobbyMessageRecipient : _privateMessageRecipient
})}

View File

@@ -55,7 +55,6 @@ external_services = {
};
muc_mapper_domain_base = 'vX.meet.jitsi';
main_domain = 'jitmeet.example.com';
-- https://prosody.im/doc/modules/mod_smacks
smacks_max_unacked_stanzas = 5;

View File

@@ -20,28 +20,18 @@ local get_room_from_jid = util.get_room_from_jid;
local get_focus_occupant = util.get_focus_occupant;
local internal_room_jid_match_rewrite = util.internal_room_jid_match_rewrite;
-- this is the main virtual host of this vnode
local local_domain = module:get_option_string('muc_mapper_domain_base');
if not local_domain then
module:log('warn', "No 'muc_mapper_domain_base' option set, disabling fmuc plugin");
return;
end
-- this is the main virtual host of the main prosody that this vnode serves
local main_domain = module:get_option_string('main_domain');
if not main_domain then
module:log('warn', "No 'main_domain' option set, disabling fmuc plugin");
return;
end
local muc_domain_prefix = module:get_option_string('muc_mapper_domain_prefix', 'conference');
local main_domain = string.gsub(module.host, muc_domain_prefix..'.', '');
local NICK_NS = 'http://jabber.org/protocol/nick';
-- we send stats for the total number of rooms, total number of participants and total number of visitors
local measure_rooms = module:measure('vnode-rooms', 'amount');
local measure_participants = module:measure('vnode-participants', 'amount');
local measure_visitors = module:measure('vnode-visitors', 'amount');
local measure_rooms = module:measure("vnode-rooms", "amount");
local measure_participants = module:measure("vnode-participants", "amount");
local measure_visitors = module:measure("vnode-visitors", "amount");
-- This is the domain of the main prosody that is federating with us;
local fmuc_main_domain;
local sent_iq_cache = require 'util.cache'.new(200);
@@ -55,8 +45,12 @@ module:hook('muc-occupant-pre-join', function (event)
local occupant, session = event.occupant, event.origin;
local node, host = jid.split(occupant.bare_jid);
if host == local_domain then
if host == main_domain then
occupant.role = 'visitor';
elseif not fmuc_main_domain then
if node ~= 'focus' then
fmuc_main_domain = host;
end
end
end, 3);
@@ -109,7 +103,7 @@ module:hook('muc-occupant-left', function (event)
local room, occupant = event.room, event.occupant;
local occupant_domain = jid.host(occupant.bare_jid);
if occupant_domain == local_domain then
if occupant_domain == main_domain then
local focus_occupant = get_focus_occupant(room);
if not focus_occupant then
module:log('warn', 'No focus found for %s', room.jid);
@@ -187,11 +181,11 @@ module:hook('muc-broadcast-presence', function (event)
sent_iq_cache:set(iq_id, socket.gettime());
local promotion_request = st.iq({
type = 'set',
to = 'visitors.'..main_domain,
from = local_domain,
to = 'visitors.'..fmuc_main_domain,
from = main_domain,
id = iq_id })
:tag('visitors', { xmlns = 'jitsi:visitors',
room = jid.join(jid.node(room.jid), muc_domain_prefix..'.'..main_domain) })
room = jid.join(jid.node(room.jid), muc_domain_prefix..'.'..fmuc_main_domain) })
:tag('promotion-request', { xmlns = 'jitsi:visitors', jid = occupant.jid }):up();
local nick_element = occupant:get_presence():get_child('nick', NICK_NS);
@@ -227,8 +221,8 @@ local function stanza_handler(event)
return;
end
if stanza.attr.from ~= 'visitors.'..main_domain then
module:log('warn', 'not from visitors component, ignore! %s', stanza);
if stanza.attr.from ~= 'visitors.'..fmuc_main_domain then
module:log('warn', 'not from visitors component, ignore! %s %s', stanza.attr.from, stanza);
return true;
end
@@ -247,7 +241,7 @@ local function stanza_handler(event)
-- respond with successful receiving the iq
origin.send(st.iq({
type = 'result';
type = "result";
from = stanza.attr.to;
to = stanza.attr.from;
id = stanza.attr.id
@@ -282,12 +276,12 @@ function process_host_module(name, callback)
process_host(name);
end
end
process_host_module(local_domain, function(host_module, host)
process_host_module(main_domain, function(host_module, host)
host_module:hook('iq/host', stanza_handler, 10);
end);
-- only live chat is supported for visitors
module:hook('muc-occupant-groupchat', function(event)
module:hook("muc-occupant-groupchat", function(event)
local occupant, room, stanza = event.occupant, event.room, event.stanza;
local from = stanza.attr.from;
local occupant_host = jid.host(occupant.bare_jid);
@@ -295,7 +289,7 @@ module:hook('muc-occupant-groupchat', function(event)
-- if there is no occupant this is a message from main, probably coming from other vnode
if occupant then
-- we manage nick only for visitors
if occupant_host ~= main_domain then
if occupant_host ~= fmuc_main_domain then
-- add to message stanza display name for the visitor
-- remove existing nick to avoid forgery
stanza:remove_children('nick', NICK_NS);
@@ -316,15 +310,15 @@ module:hook('muc-occupant-groupchat', function(event)
-- let's send it to main chat and rest of visitors here
for _, o in room:each_occupant() do
-- filter remote occupants
if jid.host(o.bare_jid) == local_domain then
if jid.host(o.bare_jid) == main_domain then
room:route_to_occupant(o, stanza)
end
end
-- send to main participants only messages from local occupants (skip from remote vnodes)
if occupant and occupant_host ~= main_domain then
if occupant and occupant_host ~= fmuc_main_domain then
local main_message = st.clone(stanza);
main_message.attr.to = jid.join(jid.node(room.jid), muc_domain_prefix..'.'..main_domain);
main_message.attr.to = jid.join(jid.node(room.jid), muc_domain_prefix..'.'..fmuc_main_domain);
module:send(main_message);
end
stanza.attr.from = from; -- something prosody does internally
@@ -334,20 +328,20 @@ end, 55); -- prosody check for visitor's chat is prio 50, we want to override it
module:hook('muc-private-message', function(event)
-- private messaging is forbidden
event.origin.send(st.error_reply(event.stanza, 'auth', 'forbidden',
'Private messaging is disabled on visitor nodes'));
event.origin.send(st.error_reply(event.stanza, "auth", "forbidden",
"Private messaging is disabled on visitor nodes"));
return true;
end, 10);
-- we calculate the stats on the configured interval (60 seconds by default)
module:hook_global('stats-update', function ()
module:hook_global("stats-update", function ()
local participants_count, rooms_count, visitors_count = 0, 0, 0;
-- iterate over all rooms
for room in prosody.hosts[module.host].modules.muc.each_room() do
rooms_count = rooms_count + 1;
for _, o in room:each_occupant() do
if jid.host(o.bare_jid) == local_domain then
if jid.host(o.bare_jid) == main_domain then
visitors_count = visitors_count + 1;
else
participants_count = participants_count + 1;
@@ -362,80 +356,4 @@ module:hook_global('stats-update', function ()
measure_participants(participants_count);
end);
-- we skip it till the main participants are added from the main prosody
module:hook('jicofo-unlock-room', function(e)
-- we do not block events we fired
if e.fmuc_fired then
return;
end
return true;
end);
-- handles incoming iq connect stanzas
local function iq_from_main_handler(event)
local origin, stanza = event.origin, event.stanza;
if stanza.name ~= 'iq' then
return;
end
if stanza.attr.type == 'result' and sent_iq_cache:get(stanza.attr.id) then
sent_iq_cache:set(stanza.attr.id, nil);
return true;
end
if stanza.attr.type ~= 'set' then
return;
end
local visitors_iq = event.stanza:get_child('visitors', 'jitsi:visitors');
if not visitors_iq then
return;
end
if stanza.attr.from ~= main_domain then
module:log('warn', 'not from main prosody, ignore! %s', stanza);
return true;
end
local room_jid = visitors_iq.attr.room;
local room = get_room_from_jid(room_jid_match_rewrite(room_jid));
if not room then
module:log('warn', 'No room found %s', room_jid);
return;
end
local node = visitors_iq:get_child('connect');
local fire_jicofo_unlock = true;
if not node then
node = visitors_iq:get_child('update');
fire_jicofo_unlock = false;
end
if not node then
return;
end
-- respond with successful receiving the iq
origin.send(st.iq({
type = 'result';
from = stanza.attr.to;
to = stanza.attr.from;
id = stanza.attr.id
}));
-- if there is password supplied use it
-- if this is update it will either set or remove the password
room:set_password(node.attr.password);
if fire_jicofo_unlock then
-- everything is connected allow participants to join
module:fire_event('jicofo-unlock-room', { room = room; fmuc_fired = true; });
end
return true;
end
module:hook('iq/host', iq_from_main_handler, 10);

View File

@@ -10,7 +10,6 @@
--- NOTE: Make sure all communication between prosodies is using the real jids ([foo]room1@muc.example.com)
local st = require 'util.stanza';
local jid = require 'util.jid';
local new_id = require 'util.id'.medium;
local util = module:require 'util';
local presence_check_status = util.presence_check_status;
@@ -37,8 +36,6 @@ local ignore_list = module:get_option_set('visitors_ignore_list', {});
-- Advertise the component for discovery via disco#items
module:add_identity('component', 'visitors', 'visitors.'..module.host);
local sent_iq_cache = require 'util.cache'.new(200);
-- visitors_nodes = {
-- roomjid1 = {
-- nodes = {
@@ -50,24 +47,6 @@ local sent_iq_cache = require 'util.cache'.new(200);
--}
local visitors_nodes = {};
-- sends connect or update iq
-- @parameter type - Type of iq to send 'connect' or 'update'
local function send_visitors_iq(conference_service, room, type)
-- send iq informing the vnode that the connect is done and it will allow visitors to join
local iq_id = new_id();
sent_iq_cache:set(iq_id, socket.gettime());
local connect_done = st.iq({
type = 'set',
to = conference_service,
from = module.host,
id = iq_id })
:tag('visitors', { xmlns = 'jitsi:visitors',
room = jid.join(jid.node(room.jid), conference_service) })
:tag(type, { xmlns = 'jitsi:visitors', password = room:get_password() or '' }):up();
module:send(connect_done);
end
-- an event received from visitors component, which receives iqs from jicofo
local function connect_vnode(event)
local room, vnode = event.room, event.vnode;
@@ -96,15 +75,7 @@ local function connect_vnode(event)
fmuc_pr.attr.to = jid.join(user, conference_service , res);
fmuc_pr.attr.from = o.jid;
-- add <x>
fmuc_pr:tag('x', { xmlns = MUC_NS });
-- if there is a password on the main room let's add the password for the vnode join
-- as we will set the password to the vnode room and we will need it
local pass = room:get_password();
if pass and pass ~= '' then
fmuc_pr:tag('password'):text(pass);
end
fmuc_pr:up();
fmuc_pr:tag('x', { xmlns = MUC_NS }):up();
module:send(fmuc_pr);
@@ -112,26 +83,9 @@ local function connect_vnode(event)
end
end
visitors_nodes[room.jid].nodes[conference_service] = sent_main_participants;
send_visitors_iq(conference_service, room, 'connect');
end
module:hook('jitsi-connect-vnode', connect_vnode);
-- listens for responses to the iq sent for connecting vnode
local function stanza_handler(event)
local origin, stanza = event.origin, event.stanza;
if stanza.name ~= 'iq' then
return;
end
if stanza.attr.type == 'result' and sent_iq_cache:get(stanza.attr.id) then
sent_iq_cache:set(stanza.attr.id, nil);
return true;
end
end
module:hook('iq/host', stanza_handler, 10);
-- an event received from visitors component, which receives iqs from jicofo
local function disconnect_vnode(event)
local room, vnode = event.room, event.vnode;
@@ -257,7 +211,7 @@ process_host_module(main_muc_component_config, function(host_module, host)
end
end);
-- forwards messages from main participants to vnodes
host_module:hook('muc-occupant-groupchat', function(event)
host_module:hook("muc-occupant-groupchat", function(event)
local room, stanza, occupant = event.room, event.stanza, event.occupant;
-- filter sending messages from transcribers/jibris to visitors
@@ -277,7 +231,7 @@ process_host_module(main_muc_component_config, function(host_module, host)
end);
-- receiving messages from visitor nodes and forward them to local main participants
-- and forward them to the rest of visitor nodes
host_module:hook('muc-occupant-groupchat', function(event)
host_module:hook("muc-occupant-groupchat", function(event)
local occupant, room, stanza = event.occupant, event.room, event.stanza;
local to = stanza.attr.to;
local from = stanza.attr.from;
@@ -306,15 +260,4 @@ process_host_module(main_muc_component_config, function(host_module, host)
return true;
end, 55); -- prosody check for unknown participant chat is prio 50, we want to override it
host_module:hook('muc-config-submitted/muc#roomconfig_roomsecret', function(event)
if event.status_codes['104'] then
local room = event.room;
-- we need to update all vnodes
local vnodes = visitors_nodes[room.jid].nodes;
for conference_service in pairs(vnodes) do
send_visitors_iq(conference_service, room, 'update');
end
end
end, -100); -- we want to run last in order to check is the status code 104
end);

View File

@@ -8,9 +8,7 @@ local get_room_from_jid = util.get_room_from_jid;
local get_focus_occupant = util.get_focus_occupant;
local get_room_by_name_and_subdomain = util.get_room_by_name_and_subdomain;
local new_id = require 'util.id'.medium;
local um_is_admin = require 'core.usermanager'.is_admin;
local MUC_NS = 'http://jabber.org/protocol/muc';
local um_is_admin = require "core.usermanager".is_admin;
local muc_domain_prefix = module:get_option_string('muc_mapper_domain_prefix', 'conference');
local muc_domain_base = module:get_option_string('muc_mapper_domain_base');
@@ -19,7 +17,7 @@ if not muc_domain_base then
return;
end
local auto_allow_promotion = module:get_option_boolean('auto_allow_visitor_promotion', false);
local auto_allow_promotion = module:get_option_boolean("auto_allow_visitor_promotion", false);
local function is_admin(jid)
return um_is_admin(jid, module.host);
@@ -35,7 +33,7 @@ local sent_iq_cache = require 'util.cache'.new(200);
local function respond_iq_result(origin, stanza)
-- respond with successful receiving the iq
origin.send(st.iq({
type = 'result';
type = "result";
from = stanza.attr.to;
to = stanza.attr.from;
id = stanza.attr.id
@@ -160,7 +158,7 @@ local function stanza_handler(event)
return processed;
end
module:hook('iq/host', stanza_handler, 10);
module:hook("iq/host", stanza_handler, 10);
--process a host module directly if loaded or hooks to wait for its load
function process_host_module(name, callback)
@@ -186,13 +184,6 @@ process_host_module(muc_domain_prefix..'.'..muc_domain_base, function(host_modul
host_module:hook('muc-occupant-pre-join', function (event)
local room, stanza, origin = event.room, event.stanza, event.origin;
-- visitors were already in the room one way or another they have access
-- skip password challenge
local join = stanza:get_child('x', MUC_NS);
if join and room:get_password() then
join:tag('password', { xmlns = MUC_NS }):text(room:get_password());
end
-- we skip any checks when auto-allow is enabled
if auto_allow_promotion then
return;
@@ -217,7 +208,7 @@ end);
-- enable only in case of auto-allow is enabled
if auto_allow_promotion then
prosody.events.add_handler('pre-jitsi-authentication', function(session)
prosody.events.add_handler("pre-jitsi-authentication", function(session)
if not session.customusername or not session.jitsi_web_query_room then
return nil;
end