From 9a861f46d028d4194666e65ba16633a3505a015f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 24 Dec 2016 03:18:12 +0000 Subject: [PATCH 1/3] make electron send email validation URLs with a nextlink of riot.im rather than file:/// --- src/vector/index.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index b791783b98..8231950b49 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -136,11 +136,20 @@ var onNewScreen = function(screen) { // click back to the client having registered. // It's up to us to recognise if we're loaded with // this URL and tell MatrixClient to resume registration. +// +// If we're in electron, we should never pass through a file:// URL otherwise +// the identity server will try to 302 the browser to it, which breaks horribly. +// so in that instance, hardcode to use riot.im/app for now instead. var makeRegistrationUrl = function() { - return window.location.protocol + '//' + - window.location.host + - window.location.pathname + - '#/register'; + if (window.location.protocol === "file:") { + return 'https://riot.im/app/#/register'; + } + else { + return window.location.protocol + '//' + + window.location.host + + window.location.pathname + + '#/register'; + } } window.addEventListener('hashchange', onHashChange); From f2afcc0bc89cebe9b2220fc75a537f2f91bf91bc Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 24 Dec 2016 18:13:20 +0000 Subject: [PATCH 2/3] add gnu-tar to debian electron build deps --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 50a8ff041e..54709e08b1 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ The only platform that can build packages for all three platforms is macOS: ``` brew install wine --without-x11 brew install mono +brew install gnu-tar npm install npm run build:electron ``` From 79d164309f7926cb1c24008e464a516d7a872325 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 24 Dec 2016 18:13:33 +0000 Subject: [PATCH 3/3] empirically fix win32 shortcut in start menu --- electron/src/squirrelhooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron/src/squirrelhooks.js b/electron/src/squirrelhooks.js index 10fb8d9ec5..295ef5cfda 100644 --- a/electron/src/squirrelhooks.js +++ b/electron/src/squirrelhooks.js @@ -3,7 +3,7 @@ const spawn = require('child_process').spawn; const app = require('electron').app; function run_update_exe(args, done) { - const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe'); + const updateExe = path.resolve(path.dirname(process.execPath), 'Update.exe'); spawn(updateExe, args, { detached: true }).on('close', done);