From c421c0b1bfeecc22bc575767920672a0daea72a0 Mon Sep 17 00:00:00 2001 From: "vectorwebexp@ares" Date: Sat, 2 Feb 2019 22:43:16 +0000 Subject: [PATCH 01/36] cleanup script for the deployment dir -- richvdh --- scripts/cleanup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/cleanup.sh diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh new file mode 100755 index 0000000000..6c174b3a66 --- /dev/null +++ b/scripts/cleanup.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# script to clean up the deployments made by redeploy.py for vectorwebdev and vectorwebexp +set -e + +# currently live deployment (full path) +live=`dirname $(readlink -f "$HOME/live")` + +# currently live bundle (just the name of the bundle) +live_bundle=`grep 'script src="bundles' live/index.html | sed -e 's#.*bundles/##' -e 's#/.*##'` + +# clean up 'extracted': find things which are older than 7 days, exclude the current live one, and remove +find $HOME/extracted -maxdepth 1 -type d -ctime +7 \! -path "$live" -exec rm -r {} \; + +# clean up 'bundles': ditto +find $HOME/bundles -maxdepth 1 -type d -ctime +7 \! -name "$live_bundle" -exec rm -r {} \; From a9293311607385d6be59f85505c0622a1335929e Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 18:45:24 +0000 Subject: [PATCH 02/36] released js-sdk & react-sdk --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 30a209d58b..26b0aa9040 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", - "matrix-js-sdk": "0.14.3", - "matrix-react-sdk": "0.14.8", + "matrix-js-sdk": "1.0.0-rc.1", + "matrix-react-sdk": "1.0.0-rc.1", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From a51c0744e644f151b3cbc2f0db0d91589d6bebd5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 18:45:53 +0000 Subject: [PATCH 03/36] v1.0.0-rc.1 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 8d88140551..72b570638c 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "0.17.9", + "version": "1.0.0-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From 41ac8d4e01716e66214a2b0a05c9a342b3986bae Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 18:47:23 +0000 Subject: [PATCH 04/36] Prepare changelog for v1.0.0-rc.1 --- CHANGELOG.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba5de17582..99e15a264c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,72 @@ +Changes in [1.0.0-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.0-rc.1) (2019-02-08) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.9...v1.0.0-rc.1) + + * Update from Weblate. + [\#8475](https://github.com/vector-im/riot-web/pull/8475) + * Add configurable welcome page + [\#8466](https://github.com/vector-im/riot-web/pull/8466) + * fix app tests after force enabling lazy loading + removing feature flag + [\#8464](https://github.com/vector-im/riot-web/pull/8464) + * Allow Electron to zoom with CommandOrControl+= + [\#8381](https://github.com/vector-im/riot-web/pull/8381) + * Hide sign in / create account for logged in users + [\#8368](https://github.com/vector-im/riot-web/pull/8368) + * Fix home page link target + [\#8365](https://github.com/vector-im/riot-web/pull/8365) + * Add auth background image and update Riot logo + [\#8364](https://github.com/vector-im/riot-web/pull/8364) + * New homepage + [\#8363](https://github.com/vector-im/riot-web/pull/8363) + * Spell homeserver correctly + [\#8358](https://github.com/vector-im/riot-web/pull/8358) + * Merge redesign into develop + [\#8321](https://github.com/vector-im/riot-web/pull/8321) + * Disable room directory test because it doesn't work + [\#8318](https://github.com/vector-im/riot-web/pull/8318) + * Tweak auth overflow on Windows and Linux + [\#8307](https://github.com/vector-im/riot-web/pull/8307) + * Clean up Custom Server Help dialog + [\#8296](https://github.com/vector-im/riot-web/pull/8296) + * Cache-bust olm.wasm + [\#8283](https://github.com/vector-im/riot-web/pull/8283) + * Completely disable other themes for now (#8277) + [\#8280](https://github.com/vector-im/riot-web/pull/8280) + * Remove support for team servers + [\#8271](https://github.com/vector-im/riot-web/pull/8271) + * Add target="_blank" to footer links + [\#8248](https://github.com/vector-im/riot-web/pull/8248) + * Fix device names on desktop + [\#8241](https://github.com/vector-im/riot-web/pull/8241) + * Fix literal </> in notifications + [\#8238](https://github.com/vector-im/riot-web/pull/8238) + * Fix registration nextLink on desktop + [\#8239](https://github.com/vector-im/riot-web/pull/8239) + * Add returns to fetch-develop-deps + [\#8233](https://github.com/vector-im/riot-web/pull/8233) + * Update electron builder + [\#8231](https://github.com/vector-im/riot-web/pull/8231) + * Try fetching more branches for PRs + [\#8225](https://github.com/vector-im/riot-web/pull/8225) + * Use content hashing for font and image URLs + [\#8159](https://github.com/vector-im/riot-web/pull/8159) + * Develop->Experimental + [\#8156](https://github.com/vector-im/riot-web/pull/8156) + * Update from Weblate. + [\#8150](https://github.com/vector-im/riot-web/pull/8150) + * Correct the copying of e-mail addresses in the electron app + [\#8124](https://github.com/vector-im/riot-web/pull/8124) + * Start documenting keyboard shortcuts + [\#7165](https://github.com/vector-im/riot-web/pull/7165) + * Update issue templates + [\#7948](https://github.com/vector-im/riot-web/pull/7948) + * Added new colour var to all themes + [\#7927](https://github.com/vector-im/riot-web/pull/7927) + * Redesign: apply changes from dharma theme to status theme + [\#7541](https://github.com/vector-im/riot-web/pull/7541) + * Redesign: ignore setting and always show dharma theme for now + [\#7540](https://github.com/vector-im/riot-web/pull/7540) + Changes in [0.17.9](https://github.com/vector-im/riot-web/releases/tag/v0.17.9) (2019-01-22) ============================================================================================ [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.9-rc.1...v0.17.9) From 8dca2502cd77ad92b3da685a88e0f6b7bb703ff3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 18:47:23 +0000 Subject: [PATCH 05/36] v1.0.0-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26b0aa9040..5f7af9338f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "0.17.9", + "version": "1.0.0-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From d395fdcc6a4240c683fc19b9f98575c859f71ecc Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Wed, 13 Feb 2019 11:59:36 +0100 Subject: [PATCH 06/36] Make scripts/make-icons.sh work on linux This commit detects if the macos-only utility `iconutil` is available in the PATH, if it is, then the icns is built as usual. However if it isn't (such as on a linux system), then it checks for `png2icns` and uses it if possible. Signed-off-by: Abel Luck --- scripts/make-icons.sh | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/make-icons.sh b/scripts/make-icons.sh index 19e48895df..2db5293df3 100755 --- a/scripts/make-icons.sh +++ b/scripts/make-icons.sh @@ -1,4 +1,10 @@ #!/bin/bash +# +# Converts an svg logo into the various image resources required by +# the various platforms deployments. +# +# On debian-based systems you need these deps: +# apt-get install xmlstarlet python3-cairosvg icnsutils if [ $# != 1 ] then @@ -52,7 +58,23 @@ cp "$tmpdir/256.png" "$tmpdir/Riot.iconset/icon_256x256.png" cp "$tmpdir/512.png" "$tmpdir/Riot.iconset/icon_256x256@2x.png" cp "$tmpdir/512.png" "$tmpdir/Riot.iconset/icon_512x512.png" cp "$tmpdir/1024.png" "$tmpdir/Riot.iconset/icon_512x512@2x.png" -iconutil -c icns -o electron_app/build/icon.icns "$tmpdir/Riot.iconset" + +if [ -x "$(command -v iconutil)" ]; then + # available on macos + iconutil -c icns -o electron_app/build/icon.icns "$tmpdir/Riot.iconset" +elif [ -x "$(command -v png2icns)" ]; then + # available on linux + # png2icns is more finicky about its input than iconutil + # 1. it doesn't support a 64x64 (aka 32x32@2x) + # 2. it doesn't like duplicates (128x128@2x == 256x256) + rm "$tmpdir/Riot.iconset/icon_128x128@2x.png" + rm "$tmpdir/Riot.iconset/icon_256x256@2x.png" + rm "$tmpdir/Riot.iconset/icon_16x16@2x.png" + rm "$tmpdir/Riot.iconset/icon_32x32@2x.png" + png2icns electron_app/build/icon.icns "$tmpdir"/Riot.iconset/*png +else + echo "WARNING: Unsupported platform. Skipping icns build" +fi cp "$tmpdir/36.png" "res/vector-icons/android-chrome-36x36.png" cp "$tmpdir/48.png" "res/vector-icons/android-chrome-48x48.png" From 39e16a18e2a4078489f8caa949d905154aab3872 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 11:18:24 +0000 Subject: [PATCH 07/36] Update dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5f7af9338f..3b5f6e6124 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", - "matrix-js-sdk": "1.0.0-rc.1", - "matrix-react-sdk": "1.0.0-rc.1", + "matrix-js-sdk": "1.0.0-rc.2", + "matrix-react-sdk": "1.0.0-rc.2", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From 21f11f02a45924cd14b1716d26c299fea3d8d4b2 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 11:19:06 +0000 Subject: [PATCH 08/36] v1.0.0-rc.2 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 72b570638c..f027f89372 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "1.0.0-rc.1", + "version": "1.0.0-rc.2", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From d98216391116e7ac5e376baddbc2b3156d721adf Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 11:20:03 +0000 Subject: [PATCH 09/36] Prepare changelog for v1.0.0-rc.2 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99e15a264c..19bde739f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +Changes in [1.0.0-rc.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.0-rc.2) (2019-02-14) +==================================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0-rc.1...v1.0.0-rc.2) + + * Update from Weblate. + [\#8615](https://github.com/vector-im/riot-web/pull/8615) + * Replace favicon assets to ones with transparent backgrounds + [\#8600](https://github.com/vector-im/riot-web/pull/8600) + * Refreshed icons + [\#8594](https://github.com/vector-im/riot-web/pull/8594) + * Fix order of fetch-develop-deps / npm install + [\#8566](https://github.com/vector-im/riot-web/pull/8566) + * Revive building dark theme + [\#8540](https://github.com/vector-im/riot-web/pull/8540) + * Update from Weblate. + [\#8546](https://github.com/vector-im/riot-web/pull/8546) + * Repair app loading tests after welcome page + [\#8525](https://github.com/vector-im/riot-web/pull/8525) + * Support configurable welcome background and logo + [\#8528](https://github.com/vector-im/riot-web/pull/8528) + * Update from Weblate. + [\#8518](https://github.com/vector-im/riot-web/pull/8518) + * Document `embeddedPages` configuration + [\#8514](https://github.com/vector-im/riot-web/pull/8514) + * README.md : Syntax Coloring + [\#8502](https://github.com/vector-im/riot-web/pull/8502) + Changes in [1.0.0-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.0-rc.1) (2019-02-08) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.17.9...v1.0.0-rc.1) From 1c1ebfa78425cf04d02800ef66547b56e1f8e905 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 11:20:03 +0000 Subject: [PATCH 10/36] v1.0.0-rc.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b5f6e6124..23c689c7e4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "1.0.0-rc.1", + "version": "1.0.0-rc.2", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 755ad2248912974b4de96b1a17628edb3e3b999b Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 12:24:25 +0000 Subject: [PATCH 11/36] Upgrade electron-builder-squirrel-windows --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23c689c7e4..2be3bb3335 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "cross-env": "^4.0.0", "css-loader": "^2.1.0", "electron-builder": "^20.38.5", - "electron-builder-squirrel-windows": "^11.6.1", + "electron-builder-squirrel-windows": "^20.38.5", "electron-devtools-installer": "^2.2.4", "emojione": "^2.2.7", "eslint": "^5.8.0", From 0f4757c289eb39d29a3668b19e7166b8a8a1f086 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 12:54:26 +0000 Subject: [PATCH 12/36] Fix up packaging directories for Windows --- scripts/electron-package.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/electron-package.sh b/scripts/electron-package.sh index bd68d9c2cc..ba3eaa5131 100755 --- a/scripts/electron-package.sh +++ b/scripts/electron-package.sh @@ -104,10 +104,10 @@ cp $distdir/*.dmg "$pubdir/install/macos/" # Windows installers go to the dist dir because they need signing mkdir -p "$pubdir/install/win32/ia32/" -cp $distdir/win-ia32/*.exe "$projdir/electron_app/dist/unsigned/" +cp $distdir/squirrel-windows-ia32/*.exe "$projdir/electron_app/dist/unsigned/" mkdir -p "$pubdir/install/win32/x64/" -cp $distdir/win/*.exe "$projdir/electron_app/dist/unsigned/" +cp $distdir/squirrel-windows/*.exe "$projdir/electron_app/dist/unsigned/" # Packages for auto-update mkdir -p "$pubdir/update/macos" @@ -115,12 +115,12 @@ cp $distdir/*-mac.zip "$pubdir/update/macos/" echo "$vername" > "$pubdir/update/macos/latest" mkdir -p "$pubdir/update/win32/ia32/" -cp $distdir/win-ia32/*.nupkg "$pubdir/update/win32/ia32/" -cp $distdir/win-ia32/RELEASES "$pubdir/update/win32/ia32/" +cp $distdir/squirrel-windows-ia32/*.nupkg "$pubdir/update/win32/ia32/" +cp $distdir/squirrel-windows-ia32/RELEASES "$pubdir/update/win32/ia32/" mkdir -p "$pubdir/update/win32/x64/" -cp $distdir/win/*.nupkg "$pubdir/update/win32/x64/" -cp $distdir/win/RELEASES "$pubdir/update/win32/x64/" +cp $distdir/squirrel-windows/*.nupkg "$pubdir/update/win32/x64/" +cp $distdir/squirrel-windows/RELEASES "$pubdir/update/win32/x64/" # Move the debs to the main project dir's dist folder cp $distdir/*.deb "$projdir/electron_app/dist/" From 2b069fce7598365e027574a69eda6ec955775ee9 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 13:05:49 +0000 Subject: [PATCH 13/36] Copy unsigned builds to separate dirs --- scripts/electron-package.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/electron-package.sh b/scripts/electron-package.sh index ba3eaa5131..534c3eb0da 100755 --- a/scripts/electron-package.sh +++ b/scripts/electron-package.sh @@ -104,10 +104,10 @@ cp $distdir/*.dmg "$pubdir/install/macos/" # Windows installers go to the dist dir because they need signing mkdir -p "$pubdir/install/win32/ia32/" -cp $distdir/squirrel-windows-ia32/*.exe "$projdir/electron_app/dist/unsigned/" +cp $distdir/squirrel-windows-ia32/*.exe "$projdir/electron_app/dist/unsigned/ia32/" mkdir -p "$pubdir/install/win32/x64/" -cp $distdir/squirrel-windows/*.exe "$projdir/electron_app/dist/unsigned/" +cp $distdir/squirrel-windows/*.exe "$projdir/electron_app/dist/unsigned/x64/" # Packages for auto-update mkdir -p "$pubdir/update/macos" From 4872992ba26ef998bacb6c399d7de5dffdaf2f37 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 13:13:53 +0000 Subject: [PATCH 14/36] Make arch specific directories --- scripts/electron-package.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/electron-package.sh b/scripts/electron-package.sh index 534c3eb0da..bffb6b00ec 100755 --- a/scripts/electron-package.sh +++ b/scripts/electron-package.sh @@ -104,9 +104,11 @@ cp $distdir/*.dmg "$pubdir/install/macos/" # Windows installers go to the dist dir because they need signing mkdir -p "$pubdir/install/win32/ia32/" +mkdir -p "$projdir/electron_app/dist/unsigned/ia32/" cp $distdir/squirrel-windows-ia32/*.exe "$projdir/electron_app/dist/unsigned/ia32/" mkdir -p "$pubdir/install/win32/x64/" +mkdir -p "$projdir/electron_app/dist/unsigned/x64/" cp $distdir/squirrel-windows/*.exe "$projdir/electron_app/dist/unsigned/x64/" # Packages for auto-update From 47fbe1f6007c59e21bf78d34378e128796944eb6 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 16:59:01 +0000 Subject: [PATCH 15/36] Update dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2be3bb3335..b350a6aa8d 100644 --- a/package.json +++ b/package.json @@ -70,8 +70,8 @@ "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279", "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", - "matrix-js-sdk": "1.0.0-rc.2", - "matrix-react-sdk": "1.0.0-rc.2", + "matrix-js-sdk": "1.0.0", + "matrix-react-sdk": "1.0.0", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From 55da52debd1bbe576ffeed2522de4183c6987a36 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 17:07:27 +0000 Subject: [PATCH 16/36] v1.0.0 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index f027f89372..63250c9ae6 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From 27f1c5476b3fa9bd7cf2d88899e9b2e53d74d13f Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 17:08:42 +0000 Subject: [PATCH 17/36] Prepare changelog for v1.0.0 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19bde739f7..778ee0493f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +Changes in [1.0.0](https://github.com/vector-im/riot-web/releases/tag/v1.0.0) (2019-02-14) +========================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0-rc.2...v1.0.0) + + * Add snipping lines to welcome page without guests + [\#8634](https://github.com/vector-im/riot-web/pull/8634) + * Add home page to fix loading tests + [\#8625](https://github.com/vector-im/riot-web/pull/8625) + Changes in [1.0.0-rc.2](https://github.com/vector-im/riot-web/releases/tag/v1.0.0-rc.2) (2019-02-14) ==================================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0-rc.1...v1.0.0-rc.2) From 3b123ce5c1cae341079446c4bdca795b6fc13f8e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 14 Feb 2019 17:08:42 +0000 Subject: [PATCH 18/36] v1.0.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 879800dff7..2bacb6e259 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "riot-web", - "version": "0.17.8", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b350a6aa8d..36b84f89fb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "1.0.0-rc.2", + "version": "1.0.0", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From c953791cd08c086e75e2ccb3eee3c1ed8801fbba Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 13:57:04 +0100 Subject: [PATCH 19/36] bump matrix-react-sdk to 1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 36b84f89fb..6690d59d49 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "matrix-js-sdk": "1.0.0", - "matrix-react-sdk": "1.0.0", + "matrix-react-sdk": "1.0.1", "modernizr": "^3.6.0", "prop-types": "^15.6.2", "react": "^15.6.0", From 77b317b3cf7425bc4c4c103d92e4165baa0c579a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 14:00:01 +0100 Subject: [PATCH 20/36] v1.0.1 --- electron_app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron_app/package.json b/electron_app/package.json index 63250c9ae6..8481db77a7 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "src/electron-main.js", - "version": "1.0.0", + "version": "1.0.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "dependencies": { From 88ed1937254d8578062be508ef3d50c2738af897 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 14:01:19 +0100 Subject: [PATCH 21/36] Prepare changelog for v1.0.1 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778ee0493f..522b7f5b36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +Changes in [1.0.1](https://github.com/vector-im/riot-web/releases/tag/v1.0.1) (2019-02-15) +========================================================================================== +[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0...v1.0.1) + + Changes in [1.0.0](https://github.com/vector-im/riot-web/releases/tag/v1.0.0) (2019-02-14) ========================================================================================== [Full Changelog](https://github.com/vector-im/riot-web/compare/v1.0.0-rc.2...v1.0.0) From 1b501f65828902f3eb9c889e7bb113bcebae3db0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 14:01:19 +0100 Subject: [PATCH 22/36] v1.0.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2bacb6e259..903d8ccfa2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "riot-web", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6690d59d49..de7847c34b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "riot-web", "productName": "Riot", "main": "electron_app/src/electron-main.js", - "version": "1.0.0", + "version": "1.0.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 2e60037d9f8ef334bac93b864a8c7fec4a890b27 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 15 Feb 2019 16:11:33 +0100 Subject: [PATCH 23/36] add cache busting for app icons and msapp config xml --- src/vector/index.html | 24 ++++++++++++------------ webpack.config.js | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vector/index.html b/src/vector/index.html index 5451ec5232..f24007c964 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -3,22 +3,22 @@ Riot - - - - - - - - - + + + + + + + + + - + - - + + <% for (var i=0; i < htmlWebpackPlugin.files.css.length; i++) { diff --git a/webpack.config.js b/webpack.config.js index aba990541b..6786d9e492 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -61,7 +61,7 @@ module.exports = { }), }, { - test: /\.(gif|png|svg|ttf)$/, + test: /\.(gif|png|svg|ttf|xml|ico)$/, // Use a content-based hash in the name so that we can set a long cache // lifetime for assets while still delivering changes quickly. oneOf: [ From 257611f1b48940b5196dbc4ebe8491ee51a96770 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 15 Feb 2019 22:29:28 -0600 Subject: [PATCH 24/36] Remove redesign issue template The redesign is just the design now Signed-off-by: Aaron Raimist --- .github/ISSUE_TEMPLATE/redesign_issue.md | 32 ------------------------ 1 file changed, 32 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/redesign_issue.md diff --git a/.github/ISSUE_TEMPLATE/redesign_issue.md b/.github/ISSUE_TEMPLATE/redesign_issue.md deleted file mode 100644 index 162d0a1285..0000000000 --- a/.github/ISSUE_TEMPLATE/redesign_issue.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Redesign Issue -about: Bugs, feedback or feature requests specifically associated with the Redesign - project (https://riot.im/experimental) -title: '' -labels: redesign -assignees: '' - ---- - - - -- **Browser**: Chrome, Safari, Firefox? which version? -- **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? - -### Description - -Describe here the problem that you are experiencing, or the feature you are requesting. -Include screenshots if possible: you can drag and drop images below. - -### Steps to reproduce - -- For bugs, list the steps -- that reproduce the bug -- using hyphens as bullet points - -Describe how what happens differs from what you expected. - -Log: sent/not sent? From 878190ba279312ce906c20a3e9a1148fe06a399c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 18 Feb 2019 16:11:41 +0100 Subject: [PATCH 25/36] add content hash to individual language files --- package.json | 1 + scripts/copy-res.js | 104 ++++++++++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index de7847c34b..19cc5e6af1 100644 --- a/package.json +++ b/package.json @@ -125,6 +125,7 @@ "karma-spec-reporter": "0.0.31", "karma-summary-reporter": "^1.5.1", "karma-webpack": "4.0.0-beta.0", + "loader-utils": "^1.2.3", "matrix-mock-request": "^1.2.2", "matrix-react-test-utils": "^0.2.0", "minimist": "^1.2.0", diff --git a/scripts/copy-res.js b/scripts/copy-res.js index cde96bc419..f1ed15b5d5 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +const loaderUtils = require("loader-utils"); + // copies the resources into the webapp directory. // @@ -61,12 +63,6 @@ const COPY_LIST = [ ["./config.json", "webapp", { directwatch: 1 }], ]; -INCLUDE_LANGS.forEach(function(l) { - COPY_LIST.push([ - l.value, "webapp/i18n/", { lang: 1 }, - ]); -}); - const parseArgs = require('minimist'); const Cpx = require('cpx'); const chokidar = require('chokidar'); @@ -77,8 +73,8 @@ const argv = parseArgs( process.argv.slice(2), {} ); -var watch = argv.w; -var verbose = argv.v; +const watch = argv.w; +const verbose = argv.v; function errCheck(err) { if (err) { @@ -136,39 +132,11 @@ function next(i, err) { .on('change', copy) .on('ready', cb) .on('error', errCheck); - } else if (opts.lang) { - const reactSdkFile = 'node_modules/matrix-react-sdk/src/i18n/strings/' + source + '.json'; - const riotWebFile = 'src/i18n/strings/' + source + '.json'; - - // XXX: Use a debounce because for some reason if we read the language - // file immediately after the FS event is received, the file contents - // appears empty. Possibly https://github.com/nodejs/node/issues/6112 - let makeLangDebouncer; - const makeLang = () => { - if (makeLangDebouncer) { - clearTimeout(makeLangDebouncer); - } - makeLangDebouncer = setTimeout(() => { - genLangFile(source, dest); - }, 500); - }; - - [reactSdkFile, riotWebFile].forEach(function(f) { - chokidar.watch(f) - .on('add', makeLang) - .on('change', makeLang) - //.on('ready', cb) We'd have to do this when both files are ready - .on('error', errCheck); - }); - next(i + 1, err); } else { cpx.on('watch-ready', cb); cpx.on("watch-error", cb); cpx.watch(); } - } else if (opts.lang) { - genLangFile(source, dest); - next(i + 1, err); } else { cpx.copy(cb); } @@ -195,21 +163,28 @@ function genLangFile(lang, dest) { translations = weblateToCounterpart(translations); - fs.writeFileSync(dest + lang + '.json', JSON.stringify(translations, null, 4)); + const json = JSON.stringify(translations, null, 4); + const jsonBuffer = Buffer.from(json); + const digest = loaderUtils.getHashDigest(jsonBuffer, "sha512", "base64", 7); + const filename = `${lang}.${digest}.json`; + + fs.writeFileSync(dest + filename, json); if (verbose) { - console.log("Generated language file: " + lang); + console.log("Generated language file: " + filename); } + + return filename; } -function genLangList() { +function genLangList(langFileMap) { const languages = {}; INCLUDE_LANGS.forEach(function(lang) { const normalizedLanguage = lang.value.toLowerCase().replace("_", "-"); const languageParts = normalizedLanguage.split('-'); if (languageParts.length == 2 && languageParts[0] == languageParts[1]) { - languages[languageParts[0]] = {'fileName': lang.value + '.json', 'label': lang.label}; + languages[languageParts[0]] = {'fileName': langFileMap[lang.value], 'label': lang.label}; } else { - languages[normalizedLanguage] = {'fileName': lang.value + '.json', 'label': lang.label}; + languages[normalizedLanguage] = {'fileName': langFileMap[lang.value], 'label': lang.label}; } }); fs.writeFile('webapp/i18n/languages.json', JSON.stringify(languages, null, 4), function(err) { @@ -257,5 +232,50 @@ function weblateToCounterpart(inTrs) { return outTrs; } -genLangList(); +/** +watch the input files for a given language, +regenerate the file, adding its content-hashed filename to langFileMap +and regenerating languages.json with the new filename +*/ +function watchLanguage(lang, dest, langFileMap) { + const reactSdkFile = 'node_modules/matrix-react-sdk/src/i18n/strings/' + lang + '.json'; + const riotWebFile = 'src/i18n/strings/' + lang + '.json'; + + // XXX: Use a debounce because for some reason if we read the language + // file immediately after the FS event is received, the file contents + // appears empty. Possibly https://github.com/nodejs/node/issues/6112 + let makeLangDebouncer; + const makeLang = () => { + if (makeLangDebouncer) { + clearTimeout(makeLangDebouncer); + } + makeLangDebouncer = setTimeout(() => { + const filename = genLangFile(lang, dest); + langFileMap[lang]=filename; + genLangList(langFileMap); + }, 500); + }; + + [reactSdkFile, riotWebFile].forEach(function(f) { + chokidar.watch(f) + .on('add', makeLang) + .on('change', makeLang) + .on('error', errCheck); + }); +} + +// language resources +const I18N_DEST = "webapp/i18n/"; +const I18N_FILENAME_MAP = INCLUDE_LANGS.reduce((m, l) => { + const filename = genLangFile(l.value, I18N_DEST); + m[l.value] = filename; + return m; +}, {}); +genLangList(I18N_FILENAME_MAP); + +if (watch) { + INCLUDE_LANGS.forEach(l => watchLanguage(l.value, I18N_DEST, I18N_FILENAME_MAP)); +} + +// non-language resources next(0); From 070cc77e0fb1230e7d0335fbdbbe7a3bdf344a14 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 18 Feb 2019 16:12:04 +0100 Subject: [PATCH 26/36] add content hash to languages.json file using webpack file-loader --- webpack.config.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 6786d9e492..0aa43fddce 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -60,6 +60,20 @@ module.exports = { use: "css-loader", }), }, + { + // cache-bust languages.json file placed in + // riot-web/webapp/i18n during build by copy-res.js + test: /\.*languages.json$/, + type: "javascript/auto", + use: [ + { + loader: 'file-loader', + options: { + name: 'i18n/[name].[hash:7].[ext]', + }, + }, + ], + }, { test: /\.(gif|png|svg|ttf|xml|ico)$/, // Use a content-based hash in the name so that we can set a long cache From 223d8a87ca6725d21ac41432fcb76c74785ba894 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 18 Feb 2019 16:25:19 +0100 Subject: [PATCH 27/36] move relative path in react-sdk to webpack config file otherwise react-sdk can't build anymore with riot-web in a specific location --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 0aa43fddce..629e4db2a5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -162,8 +162,8 @@ module.exports = { 'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV), }, + 'LANGUAGES_FILE': "'../../riot-web/webapp/i18n/languages.json'", // relative to languageHandler.js in matrix-react-sdk }), - new ExtractTextPlugin("bundles/[hash]/[name].css", { allChunks: true, }), From c2d14392b2e660619ebf3578fc417a4fbc5721a3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 18 Feb 2019 17:26:49 +0100 Subject: [PATCH 28/36] allow setting the relative location of the language file for running the unit tests in ci, where riot-web is a subdirectory of react-sdk --- webpack.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 629e4db2a5..c3d85caf78 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,6 +6,12 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); let og_image_url = process.env.RIOT_OG_IMAGE_URL; if (!og_image_url) og_image_url = 'https://riot.im/app/themes/riot/img/logos/riot-im-logo-black-text.png'; +// relative to languageHandler.js in matrix-react-sdk +let RIOT_LANGUAGES_FILE = process.env.RIOT_LANGUAGES_FILE; +if (!RIOT_LANGUAGES_FILE) { + RIOT_LANGUAGES_FILE = "../../riot-web/webapp/i18n/languages.json"; +} + module.exports = { entry: { // Load babel-polyfill first to avoid issues where some imports (namely react) @@ -162,7 +168,7 @@ module.exports = { 'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV), }, - 'LANGUAGES_FILE': "'../../riot-web/webapp/i18n/languages.json'", // relative to languageHandler.js in matrix-react-sdk + 'LANGUAGES_FILE': JSON.stringify(RIOT_LANGUAGES_FILE), }), new ExtractTextPlugin("bundles/[hash]/[name].css", { allChunks: true, From e56206241ba1ae683e0eb3d14122210a8217b533 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 20 Feb 2019 09:39:27 +0100 Subject: [PATCH 29/36] use same hash format as webpack defaults --- scripts/copy-res.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/copy-res.js b/scripts/copy-res.js index f1ed15b5d5..4a2c6707d0 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -165,7 +165,7 @@ function genLangFile(lang, dest) { const json = JSON.stringify(translations, null, 4); const jsonBuffer = Buffer.from(json); - const digest = loaderUtils.getHashDigest(jsonBuffer, "sha512", "base64", 7); + const digest = loaderUtils.getHashDigest(jsonBuffer, null, null, 7); const filename = `${lang}.${digest}.json`; fs.writeFileSync(dest + filename, json); From 6a9c053536e7d4e1f95da7ca00f6b7be2f7388ac Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 20 Feb 2019 09:39:42 +0100 Subject: [PATCH 30/36] simplify config entry --- webpack.config.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index c3d85caf78..70ef0574a7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -71,14 +71,10 @@ module.exports = { // riot-web/webapp/i18n during build by copy-res.js test: /\.*languages.json$/, type: "javascript/auto", - use: [ - { - loader: 'file-loader', - options: { - name: 'i18n/[name].[hash:7].[ext]', - }, - }, - ], + loader: 'file-loader', + options: { + name: 'i18n/[name].[hash:7].[ext]', + }, }, { test: /\.(gif|png|svg|ttf|xml|ico)$/, From 2dc26b4c5d0c2e4b201193d4fee36341dac57d92 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 19 Feb 2019 16:17:27 +0000 Subject: [PATCH 31/36] Document and recommend `default_server_name` This the recommended way to define a default server (instead of the existing HS and IS URL options). It will use `.well-known` discovery to find the URLs. See https://github.com/vector-im/riot-web/issues/8763. --- README.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 10fef7360e..d7c7ba96eb 100644 --- a/README.md +++ b/README.md @@ -116,17 +116,24 @@ config.json You can configure the app by copying `config.sample.json` to `config.json` and customising it: -For a good example, see https://riot.im/develop/config.json +For a good example, see https://riot.im/develop/config.json. -1. `default_hs_url` is the default homeserver url. -1. `default_is_url` is the default identity server url (this is the server used - for verifying third party identifiers like email addresses). If this is blank, - registering with an email address, adding an email address to your account, - or inviting users via email address will not work. Matrix identity servers are - very simple web services which map third party identifiers (currently only email - addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html - for more details. Currently the only public matrix identity servers are https://matrix.org - and https://vector.im. In future identity servers will be decentralised. +1. `default_server_name` sets the default server name to use for authentication. + This will trigger Riot to ask + `https:///.well-known/matrix/client` for the homeserver and + identity server URLs to use. This is the recommended approach for setting a + default server. However, it is also possible to use the following to directly + configure each of the URLs: + * `default_hs_url` sets the default homeserver URL. + * `default_is_url` sets the default identity server URL (this is the server used + for verifying third party identifiers like email addresses). If this is blank, + registering with an email address, adding an email address to your account, + or inviting users via email address will not work. Matrix identity servers are + very simple web services which map third party identifiers (currently only email + addresses) to matrix IDs: see http://matrix.org/docs/spec/identity_service/unstable.html + for more details. Currently the only public matrix identity servers are https://matrix.org + and https://vector.im. In the future, identity servers will be decentralised. + * Riot will report an error if you accidentally configure both `default_server_name` _and_ `default_hs_url` since it's unclear which should take priority. 1. `features`: Lookup of optional features that may be `enable`d, `disable`d, or exposed to the user in the `labs` section of settings. The available optional experimental features vary from release to release. From 09b17f77c21f96bda4aeb42c5c3af13b08f1faf1 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 21 Feb 2019 12:18:52 +0000 Subject: [PATCH 32/36] Fix language file path for Jenkins Jenkins seems to use a different layout of the repos than other environments. The sub-projects are cloned inside of the `riot-web` workspace. To account for this, we need to adjust the Riot language file path. --- scripts/package.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/package.sh b/scripts/package.sh index 23d0925b05..008803cac9 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -14,7 +14,11 @@ else fi npm run clean -npm run build$dev +# riot-web is at `workspace`. +# matrix-react-sdk is at `workspace/node_modules/matrix-react-sdk`, but this is +# symlinked to a repo at `workspace/matrix-react-sdk`. +# To get from `workspace/matrix-react-sdk/lib` up to the lang file, we use: +RIOT_LANGUAGES_FILE="../../webapp/i18n/languages.json" npm run build$dev # include the sample config in the tarball. Arguably this should be done by # `npm run build`, but it's just too painful. From 714570443d2213587d6266377ed9cecc9efe7c69 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 24 Feb 2019 01:08:01 +0000 Subject: [PATCH 33/36] Allow configuration of whether closing window closes or minimizes to tray Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/package.json | 1 + electron_app/src/electron-main.js | 12 +++++++++++- src/vector/platform/ElectronPlatform.js | 14 +++++++++++++- src/vector/platform/VectorBasePlatform.js | 13 ------------- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/electron_app/package.json b/electron_app/package.json index 8481db77a7..f80f3ad341 100644 --- a/electron_app/package.json +++ b/electron_app/package.json @@ -7,6 +7,7 @@ "author": "New Vector Ltd.", "dependencies": { "auto-launch": "^5.0.1", + "electron-store": "^2.0.0", "electron-window-state": "^4.1.0", "minimist": "^1.2.0", "png-to-ico": "^1.0.2" diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 12203e7906..6da7182cc7 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -35,6 +35,7 @@ const updater = require('./updater'); const { migrateFromOldOrigin } = require('./originMigrator'); const windowStateKeeper = require('electron-window-state'); +const Store = require('electron-store'); // boolean flag set whilst we are doing one-time origin migration // We only serve the origin migration script while we're actually @@ -55,8 +56,11 @@ try { // Continue with the defaults (ie. an empty config) } +const store = new Store(); + let mainWindow = null; global.appQuitting = false; +global.minimizeToTray = store.get('minimizeToTray', true); // handle uncaught errors otherwise it displays @@ -136,6 +140,12 @@ ipcMain.on('ipcCall', async function(ev, payload) { launcher.disable(); } break; + case 'getMinimizeToTrayEnabled': + ret = global.minimizeToTray; + break; + case 'setMinimizeToTrayEnabled': + store.set('minimizeToTray', global.minimizeToTray = args[0]); + break; case 'getAppVersion': ret = app.getVersion(); break; @@ -331,7 +341,7 @@ app.on('ready', () => { mainWindow = global.mainWindow = null; }); mainWindow.on('close', (e) => { - if (!global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) { + if (global.minimizeToTray && !global.appQuitting && (tray.hasTray() || process.platform === 'darwin')) { // On Mac, closing the window just hides it // (this is generally how single-window Mac apps // behave, eg. Mail.app) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 6e600cfc85..13140a2d1e 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -182,10 +182,22 @@ export default class ElectronPlatform extends VectorBasePlatform { return await this._ipcCall('getAutoLaunchEnabled'); } - async setAutoLaunchEnabled(enabled) { + async setAutoLaunchEnabled(enabled: boolean) { return await this._ipcCall('setAutoLaunchEnabled', enabled); } + supportsMinimizeToTray() { + return true; + } + + async getMinimizeToTrayEnabled() { + return await this._ipcCall('getMinimizeToTrayEnabled'); + } + + async setMinimizeToTrayEnabled(enabled: boolean) { + return await this._ipcCall('setMinimizeToTrayEnabled', enabled); + } + async canSelfUpdate(): boolean { const feedUrl = await this._ipcCall('getUpdateFeedUrl'); return Boolean(feedUrl); diff --git a/src/vector/platform/VectorBasePlatform.js b/src/vector/platform/VectorBasePlatform.js index 602a0c27c9..cfdeeacbe4 100644 --- a/src/vector/platform/VectorBasePlatform.js +++ b/src/vector/platform/VectorBasePlatform.js @@ -88,19 +88,6 @@ export default class VectorBasePlatform extends BasePlatform { this._updateFavicon(); } - supportsAutoLaunch() { - return false; - } - - // XXX: Surely this should be a setting like any other? - async getAutoLaunchEnabled() { - return false; - } - - async setAutoLaunchEnabled(enabled) { - throw new Error("Unimplemented"); - } - /** * Begin update polling, if applicable */ From 717495c4e0219ab7d1c0a49734162692665c7aa9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 24 Feb 2019 01:21:18 +0000 Subject: [PATCH 34/36] specify return types to match superclass Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 13140a2d1e..f2dd6cb782 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -174,11 +174,11 @@ export default class ElectronPlatform extends VectorBasePlatform { return await this._ipcCall('getAppVersion'); } - supportsAutoLaunch() { + supportsAutoLaunch(): boolean { return true; } - async getAutoLaunchEnabled() { + async getAutoLaunchEnabled(): boolean { return await this._ipcCall('getAutoLaunchEnabled'); } @@ -186,11 +186,11 @@ export default class ElectronPlatform extends VectorBasePlatform { return await this._ipcCall('setAutoLaunchEnabled', enabled); } - supportsMinimizeToTray() { + supportsMinimizeToTray(): boolean { return true; } - async getMinimizeToTrayEnabled() { + async getMinimizeToTrayEnabled(): boolean { return await this._ipcCall('getMinimizeToTrayEnabled'); } From 5a3b9ae4542a3673cf2de5e6d6ce2e5de1730894 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 24 Feb 2019 01:38:21 +0000 Subject: [PATCH 35/36] more matching Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index f2dd6cb782..fcab36ac39 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -182,7 +182,7 @@ export default class ElectronPlatform extends VectorBasePlatform { return await this._ipcCall('getAutoLaunchEnabled'); } - async setAutoLaunchEnabled(enabled: boolean) { + async setAutoLaunchEnabled(enabled: boolean): void { return await this._ipcCall('setAutoLaunchEnabled', enabled); } @@ -194,7 +194,7 @@ export default class ElectronPlatform extends VectorBasePlatform { return await this._ipcCall('getMinimizeToTrayEnabled'); } - async setMinimizeToTrayEnabled(enabled: boolean) { + async setMinimizeToTrayEnabled(enabled: boolean): void { return await this._ipcCall('setMinimizeToTrayEnabled', enabled); } From ffacf30722557dfbba6a05abf9ca7f7c038a2b96 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 24 Feb 2019 04:52:07 +0000 Subject: [PATCH 36/36] Allow disabling update mechanism Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/electron-main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index 12203e7906..25caddb2cf 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -147,6 +147,7 @@ ipcMain.on('ipcCall', async function(ev, payload) { } else { mainWindow.focus(); } + break; case 'origin_migrate': migratingOrigin = true; await migrateFromOldOrigin(); @@ -262,10 +263,12 @@ app.on('ready', () => { path: absTarget, }); }, (error) => { - if (error) console.error('Failed to register protocol') + if (error) console.error('Failed to register protocol'); }); - if (vectorConfig['update_base_url']) { + if (argv['no-update']) { + console.log('Auto update disabled via command line flag "--no-update"'); + } else if (vectorConfig['update_base_url']) { console.log(`Starting auto update with base URL: ${vectorConfig['update_base_url']}`); updater.start(vectorConfig['update_base_url']); } else {