1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-26 02:25:58 +01:00

Add menu entry for inviting, use native dialog on mobile.

This commit is contained in:
Juliusz Chroboczek 2023-04-04 00:30:20 +02:00
parent 3a6551c733
commit e93642f9db

View file

@ -2127,7 +2127,13 @@ function userMenu(elt) {
'setdata', serverConnection.id, {'raisehand': true}, 'setdata', serverConnection.id, {'raisehand': true},
); );
}}); }});
if(serverConnection.permissions.indexOf('present')>= 0 && canFile()) if(serverConnection.version !== "1" &&
serverConnection.permissions.indexOf('token') >= 0) {
items.push({label: 'Invite user', onClick: () => {
serverConnection.groupAction('maketoken', units.d);
}});
}
if(serverConnection.permissions.indexOf('present') >= 0 && canFile())
items.push({label: 'Broadcast file', onClick: presentFile}); items.push({label: 'Broadcast file', onClick: presentFile});
items.push({label: 'Restart media', onClick: renegotiateStreams}); items.push({label: 'Restart media', onClick: renegotiateStreams});
} else { } else {
@ -2647,6 +2653,17 @@ function gotUserMessage(id, dest, username, time, privileged, kind, error, messa
} }
let f = formatToken(message); let f = formatToken(message);
localMessage(f[0] + ': ' + f[1]); localMessage(f[0] + ': ' + f[1]);
if('share' in navigator) {
try {
navigator.share({
title: `Invitation to Galene group ${message.group}`,
text: f[0],
url: f[1],
});
} catch(e) {
console.warn("Share failed", e);
}
}
break; break;
case 'tokenlist': case 'tokenlist':
if(!privileged) { if(!privileged) {