Support for joining New Groups via invite links

This commit is contained in:
Scott Nonnenberg 2021-01-29 14:16:48 -08:00 committed by GitHub
parent c0510b08a5
commit a48b3e381e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 2532 additions and 381 deletions

13
main.js
View file

@ -1428,7 +1428,7 @@ function getIncomingHref(argv) {
}
function handleSgnlHref(incomingHref) {
const { command, args } = parseSgnlHref(incomingHref, logger);
const { command, args, hash } = parseSgnlHref(incomingHref, logger);
if (command === 'addstickers' && mainWindow && mainWindow.webContents) {
console.log('Opening sticker pack from sgnl protocol link');
const packId = args.get('pack_id');
@ -1437,6 +1437,17 @@ function handleSgnlHref(incomingHref) {
? Buffer.from(packKeyHex, 'hex').toString('base64')
: '';
mainWindow.webContents.send('show-sticker-pack', { packId, packKey });
} else if (
command === 'signal.group' &&
hash &&
mainWindow &&
mainWindow.webContents
) {
console.log('Showing group from sgnl protocol link');
mainWindow.webContents.send('show-group-via-link', { hash });
} else if (mainWindow && mainWindow.webContents) {
console.log('Showing warning that we cannot process link');
mainWindow.webContents.send('unknown-sgnl-link');
} else {
console.error('Unhandled sgnl link');
}