Compare commits

..

3 Commits

Author SHA1 Message Date
David Langley
cdc6d60e48 Update pull request template and add contributing guide for CLA 2024-09-05 20:07:21 +01:00
David Langley
cceb34315d Update LICENCE files, package.json and readme. 2024-09-05 19:14:04 +01:00
David Langley
11054ccbc4 Update file headers copyright and change licence to AGPL-3.0-only OR GPL-3.0-only 2024-09-05 18:51:53 +01:00
67 changed files with 1367 additions and 2107 deletions

View File

@@ -1,5 +1 @@
blank_issues_enabled: false
contact_links:
- name: Bug report for the Element flatpak app
url: https://github.com/flathub/im.riot.Riot/issues
about: Please file bugs with the Flatpak application on the respective repository.

View File

@@ -5,4 +5,4 @@
- [ ] Ensure your code works with manual testing.
- [ ] New or updated `public`/`exported` symbols have accurate [TSDoc](https://tsdoc.org/) documentation.
- [ ] Linter and other CI checks pass.
- [ ] I have licensed the changes to Element by completing the [Contributor License Agreement (CLA)](https://cla-assistant.io/element-hq/element-desktop)
- [ ] Changes are licensed to Element under a Contributor License Agreement (CLA) (see [CONTRIBUTING.md](https://github.com/vector-im/element-web/blob/develop/CONTRIBUTING.md)).

View File

@@ -10,7 +10,7 @@ on:
jobs:
backport:
name: Backport
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >

View File

@@ -99,7 +99,7 @@ jobs:
- macos
- linux
- windows
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
name: ${{ needs.prepare.outputs.deploy == 'true' && 'Deploy' || 'Deploy (dry-run)' }}
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
environment: ${{ needs.prepare.outputs.deploy == 'true' && 'packages.element.io' || '' }}
@@ -252,7 +252,7 @@ jobs:
deploy-ess:
needs: deploy
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
name: Deploy builds to ESS
if: needs.prepare.outputs.deploy == 'true' && github.event_name == 'release'
env:

View File

@@ -50,7 +50,7 @@ jobs:
matrix:
include:
- name: macOS Universal
os: macos-14
os: macos-latest
artifact: macos
executable: "/Users/runner/Applications/Element.app/Contents/MacOS/Element"
# We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is
@@ -60,12 +60,12 @@ jobs:
rsync -a /Volumes/Element/Element.app ~/Applications/ &&
hdiutil detach /Volumes/Element
- name: "Linux (amd64) (sqlcipher: system)"
os: ubuntu-22.04
os: ubuntu-latest
artifact: linux-amd64-sqlcipher-system
executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
- name: "Linux (amd64) (sqlcipher: static)"
os: ubuntu-22.04
os: ubuntu-latest
artifact: linux-amd64-sqlcipher-static
executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
@@ -80,11 +80,11 @@ jobs:
executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
- name: Windows (x86)
os: windows-2022
os: windows-latest
artifact: win-ia32
executable: "./dist/win-ia32-unpacked/Element.exe"
- name: Windows (x64)
os: windows-2022
os: windows-latest
artifact: win-x64
executable: "./dist/win-unpacked/Element.exe"
name: Test ${{ matrix.name }}
@@ -132,7 +132,7 @@ jobs:
RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }}
- name: Workaround macOS GHA permission issues
if: runner.os == 'macOS'
if: matrix.os == 'macos-latest'
run: |
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/opt/off/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"

View File

@@ -26,7 +26,7 @@ jobs:
# We build the hak files on native infrastructure as matrix-seshat fails to cross-compile properly
# https://github.com/matrix-org/seshat/issues/135
hak:
runs-on: ${{ inputs.arch == 'arm64' && 'dind-l-arm64' || 'ubuntu-22.04' }}
runs-on: ${{ inputs.arch == 'arm64' && 'dind-l-arm64' || 'ubuntu-latest' }}
env:
HAK_DOCKER_IMAGE: ghcr.io/element-hq/element-desktop-dockerbuild
outputs:
@@ -112,14 +112,14 @@ jobs:
- name: "Get modified files"
id: changed_files
if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request'
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275 # v45
with:
files: |
dockerbuild/**
# This allows contributors to test changes to the dockerbuild image within a pull request
- name: Build docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
if: steps.changed_files.outputs.any_modified == 'true'
with:
context: dockerbuild
@@ -148,7 +148,7 @@ jobs:
build:
needs: hak
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@@ -86,7 +86,7 @@ jobs:
run: |
yarn build:universal --publish never
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
ED_NOTARYTOOL_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}

View File

@@ -45,7 +45,7 @@ jobs:
prepare:
name: Prepare
environment: ${{ inputs.nightly && 'packages.element.io' || '' }}
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
outputs:
nightly-version: ${{ steps.versions.outputs.nightly }}
steps:
@@ -65,8 +65,7 @@ jobs:
# We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action
- name: Generate cache hash files
run: |
# Add --no-sandbox as otherwise it fails because the helper isn't setuid root. It's only getting the version.
yarn run --silent electron --no-sandbox --version > electronVersion
yarn run --silent electron --version > electronVersion
cat package.json | jq -c .hakDependencies | sha1sum > hakHash
find hak -type f -print0 | xargs -0 sha1sum >> hakHash
find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash
@@ -127,7 +126,8 @@ jobs:
BUNDLE_HASH=$(npx asar l webapp.asar | grep /bundles/ | head -n 1 | sed 's|.*/||')
WEBAPP_VERSION=$(./scripts/get-version.ts)
WEB_VERSION=${WEBAPP_VERSION:0:12}
JS_VERSION=${WEBAPP_VERSION:16:12}
REACT_VERSION=${WEBAPP_VERSION:19:12}
JS_VERSION=${WEBAPP_VERSION:35:12}
echo "### Nightly build ${{ steps.versions.outputs.nightly }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
@@ -135,6 +135,7 @@ jobs:
echo "| ----------- | ------- |" >> $GITHUB_STEP_SUMMARY
echo "| Bundle Hash | $BUNDLE_HASH |" >> $GITHUB_STEP_SUMMARY
echo "| Element Web | [$WEB_VERSION](https://github.com/element-hq/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY
echo "| React SDK | [$REACT_VERSION](https://github.com/matrix-org/matrix-react-sdk/commit/$REACT_VERSION) |" >> $GITHUB_STEP_SUMMARY
echo "| JS SDK | [$JS_VERSION](https://github.com/matrix-org/matrix-js-sdk/commit/$JS_VERSION) |" >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v4

View File

@@ -2,7 +2,7 @@
# Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
# the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
# Windows GHA runner by default uses the pwsh shell which breaks codeSigningCert in the workflow
# window-latest by default uses the pwsh shell which breaks codeSigningCert in the workflow
defaults:
run:
shell: powershell
@@ -30,7 +30,7 @@ on:
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
jobs:
build:
runs-on: windows-2022
runs-on: windows-latest
environment: ${{ inputs.sign && 'packages.element.io' || '' }}
env:
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe"

View File

@@ -12,7 +12,7 @@ env:
jobs:
build:
name: Docker Build
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
@@ -23,12 +23,12 @@ jobs:
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
with:
install: true
- name: Log in to the Container registry
uses: docker/login-action@1f36f5b7a2d2f7bfd524795fc966e6d88c37baa9
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -43,7 +43,7 @@ jobs:
type=ref,event=branch
- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
with:
context: dockerbuild
push: true

View File

@@ -26,7 +26,7 @@ jobs:
check:
name: Post release checks
needs: release
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: Wait for desktop packaging
uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork

View File

@@ -6,7 +6,7 @@ on:
jobs:
ts_lint:
name: "Typescript Syntax Check"
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -30,7 +30,7 @@ jobs:
js_lint:
name: "ESLint"
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
workflow_lint:
name: "Workflow Lint"
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -66,7 +66,7 @@ jobs:
analyse_dead_code:
name: "Analyse Dead Code"
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@@ -6,7 +6,7 @@ on:
jobs:
automate-project-columns-next:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:

View File

@@ -1,185 +1,3 @@
Changes in [1.11.85](https://github.com/element-hq/element-desktop/releases/tag/v1.11.85) (2024-11-12)
======================================================================================================
# Security
- Fixes for [CVE-2024-51750](https://www.cve.org/CVERecord?id=CVE-2024-51750) / [GHSA-w36j-v56h-q9pc](https://github.com/element-hq/element-web/security/advisories/GHSA-w36j-v56h-q9pc)
- Fixes for [CVE-2024-51749](https://www.cve.org/CVERecord?id=CVE-2024-51749) / [GHSA-5486-384g-mcx2](https://github.com/element-hq/element-web/security/advisories/GHSA-5486-384g-mcx2)
- Update JS SDK with the fixes for [CVE-2024-50336](https://www.cve.org/CVERecord?id=CVE-2024-50336) / [GHSA-xvg8-m4x3-w6xr](https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-xvg8-m4x3-w6xr)
Changes in [1.11.84](https://github.com/element-hq/element-desktop/releases/tag/v1.11.84) (2024-11-05)
======================================================================================================
## ✨ Features
* Support specifying the config location manually (outside of the user's profile) ([#1921](https://github.com/element-hq/element-desktop/pull/1921)). Contributed by @Half-Shot.
* Remove abandoned MSC3886, MSC3903, MSC3906 implementations ([#28274](https://github.com/element-hq/element-web/pull/28274)). Contributed by @t3chguy.
* Update to React 18 ([#24763](https://github.com/element-hq/element-web/pull/24763)). Contributed by @t3chguy.
* Deduplicate icons using Compound ([#28239](https://github.com/element-hq/element-web/pull/28239)). Contributed by @t3chguy.
* Replace legacy Tooltips with Compound tooltips ([#28231](https://github.com/element-hq/element-web/pull/28231)). Contributed by @t3chguy.
* Deduplicate icons using Compound Design Tokens ([#28219](https://github.com/element-hq/element-web/pull/28219)). Contributed by @t3chguy.
* Add reactions to html export ([#28210](https://github.com/element-hq/element-web/pull/28210)). Contributed by @langleyd.
* Remove feature\_dehydration ([#28173](https://github.com/element-hq/element-web/pull/28173)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Improve seshat deleteContents ([#1916](https://github.com/element-hq/element-desktop/pull/1916)). Contributed by @langleyd.
* Remove upgrade encryption in `DeviceListener` and `SetupEncryptionToast` ([#28299](https://github.com/element-hq/element-web/pull/28299)). Contributed by @florianduros.
* Fix 'remove alias' button in room settings ([#28269](https://github.com/element-hq/element-web/pull/28269)). Contributed by @Dev-Gurjar.
* Add back unencrypted path in `StopGapWidgetDriver.sendToDevice` ([#28295](https://github.com/element-hq/element-web/pull/28295)). Contributed by @florianduros.
* Fix other devices not being decorated as such ([#28279](https://github.com/element-hq/element-web/pull/28279)). Contributed by @t3chguy.
* Fix pill contrast in invitation dialog ([#28250](https://github.com/element-hq/element-web/pull/28250)). Contributed by @florianduros.
* Close right panel chat when minimising maximised voip widget ([#28241](https://github.com/element-hq/element-web/pull/28241)). Contributed by @t3chguy.
* Fix develop changelog parsing ([#28232](https://github.com/element-hq/element-web/pull/28232)). Contributed by @t3chguy.
* Fix Ctrl+F shortcut not working with minimised room summary card ([#28223](https://github.com/element-hq/element-web/pull/28223)). Contributed by @t3chguy.
* Fix network dropdown missing checkbox \& aria-checked ([#28220](https://github.com/element-hq/element-web/pull/28220)). Contributed by @t3chguy.
Changes in [1.11.83](https://github.com/element-hq/element-desktop/releases/tag/v1.11.83) (2024-10-29)
======================================================================================================
## ✨ Features
* [Backport staging] Enable Element Call by default on release instances ([#1954](https://github.com/element-hq/element-desktop/pull/1954)). Contributed by @RiotRobot.
* Enable Element Call by default on release instances ([#28314](https://github.com/element-hq/element-web/pull/28314)). Contributed by @t3chguy.
Changes in [1.11.82](https://github.com/element-hq/element-desktop/releases/tag/v1.11.82) (2024-10-22)
======================================================================================================
## ✨ Features
* Add monochrome tray icon ([#1804](https://github.com/element-hq/element-desktop/pull/1804)). Contributed by @SakiiCode.
* Deduplicate more icons using Compound Design Tokens ([#132](https://github.com/element-hq/matrix-react-sdk/pull/132)). Contributed by @t3chguy.
* Always show link new device flow even if unsupported ([#147](https://github.com/element-hq/matrix-react-sdk/pull/147)). Contributed by @t3chguy.
* Update design of files list in right panel ([#144](https://github.com/element-hq/matrix-react-sdk/pull/144)). Contributed by @t3chguy.
* Remove feature\_dehydration ([#138](https://github.com/element-hq/matrix-react-sdk/pull/138)). Contributed by @florianduros.
* Upgrade emojibase-bindings and remove local handling of emoticon variations ([#127](https://github.com/element-hq/matrix-react-sdk/pull/127)). Contributed by @langleyd.
* Add support for rendering media captions ([#43](https://github.com/element-hq/matrix-react-sdk/pull/43)). Contributed by @tulir.
* Replace composer icons with Compound variants ([#123](https://github.com/element-hq/matrix-react-sdk/pull/123)). Contributed by @t3chguy.
* Tweak default right panel size to be 320px except for maximised widgets at 420px ([#110](https://github.com/element-hq/matrix-react-sdk/pull/110)). Contributed by @t3chguy.
* Add a pinned message badge under a pinned message ([#118](https://github.com/element-hq/matrix-react-sdk/pull/118)). Contributed by @florianduros.
* Ditch right panel tabs and re-add close button ([#99](https://github.com/element-hq/matrix-react-sdk/pull/99)). Contributed by @t3chguy.
* Force verification even for refreshed clients ([#44](https://github.com/element-hq/matrix-react-sdk/pull/44)). Contributed by @dbkr.
* Update emoji text, border and background colour in timeline ([#119](https://github.com/element-hq/matrix-react-sdk/pull/119)). Contributed by @florianduros.
* Disable ICE fallback based on well-known configuration ([#111](https://github.com/element-hq/matrix-react-sdk/pull/111)). Contributed by @t3chguy.
* Remove legacy room header and promote beta room header ([#105](https://github.com/element-hq/matrix-react-sdk/pull/105)). Contributed by @t3chguy.
* Respect `io.element.jitsi` `useFor1To1Calls` in well-known ([#112](https://github.com/element-hq/matrix-react-sdk/pull/112)). Contributed by @t3chguy.
* Use Compound close icon in favour of mishmash of x/close icons ([#108](https://github.com/element-hq/matrix-react-sdk/pull/108)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Correct typo in option documentation ([#28148](https://github.com/element-hq/element-web/pull/28148)). Contributed by @AndrewKvalheim.
* Revert #124 and #135 ([#139](https://github.com/element-hq/matrix-react-sdk/pull/139)). Contributed by @dbkr.
* Add aria-label to e2e icon ([#136](https://github.com/element-hq/matrix-react-sdk/pull/136)). Contributed by @florianduros.
* Fix bell icons on room list hover being black squares ([#135](https://github.com/element-hq/matrix-react-sdk/pull/135)). Contributed by @dbkr.
* Fix vertical overflow on the mobile register screen ([#137](https://github.com/element-hq/matrix-react-sdk/pull/137)). Contributed by @langleyd.
* Allow to unpin redacted event ([#98](https://github.com/element-hq/matrix-react-sdk/pull/98)). Contributed by @florianduros.
Changes in [1.11.81](https://github.com/element-hq/element-desktop/releases/tag/v1.11.81) (2024-10-15)
======================================================================================================
This release fixes High severity vulnerability CVE-2024-47771 / GHSA-963w-49j9-gxj6.
Changes in [1.11.80](https://github.com/element-hq/element-desktop/releases/tag/v1.11.80) (2024-10-08)
======================================================================================================
## ✨ Features
* enable Element Call on desktop nightly ([#1873](https://github.com/element-hq/element-desktop/pull/1873)). Contributed by @fkwp.
* Add doc for 'force\_verification config option ([#28035](https://github.com/element-hq/element-web/pull/28035)). Contributed by @dbkr.
* Roll back change to device isolation mode ([#104](https://github.com/element-hq/matrix-react-sdk/pull/104)). Contributed by @richvdh.
* Remove right panel toggling behaviour on room header buttons ([#100](https://github.com/element-hq/matrix-react-sdk/pull/100)). Contributed by @t3chguy.
* Improve error display for messages sent from insecure devices ([#93](https://github.com/element-hq/matrix-react-sdk/pull/93)). Contributed by @richvdh.
* Add labs option to exclude unverified devices ([#92](https://github.com/element-hq/matrix-react-sdk/pull/92)). Contributed by @richvdh.
* Improve contrast for timestamps, date separators \& spotlight trigger ([#91](https://github.com/element-hq/matrix-react-sdk/pull/91)). Contributed by @t3chguy.
* Open room settings on room header avatar click ([#88](https://github.com/element-hq/matrix-react-sdk/pull/88)). Contributed by @t3chguy.
* Use `strong` over `b` for improved a11y semantics ([#41](https://github.com/element-hq/matrix-react-sdk/pull/41)). Contributed by @t3chguy.
* Grant Element Call widget capabilities for "raise hand" feature ([#82](https://github.com/element-hq/matrix-react-sdk/pull/82)). Contributed by @AndrewFerr.
* Mobile registration optimizations and tests ([#62](https://github.com/element-hq/matrix-react-sdk/pull/62)). Contributed by @langleyd.
* Ignore chat effect when older than 48h ([#48](https://github.com/element-hq/matrix-react-sdk/pull/48)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Update native OIDC callback url to be RFC8252 compliant ([#28096](https://github.com/element-hq/element-web/pull/28096)). Contributed by @t3chguy.
* Update icons to include transparency ([#28040](https://github.com/element-hq/element-web/pull/28040)). Contributed by @t3chguy.
* Fix default\_widget\_container\_height in sample config ([#28034](https://github.com/element-hq/element-web/pull/28034)). Contributed by @dbkr.
* Fix untranslated keys being rendered in `/help` dialog ([#90](https://github.com/element-hq/matrix-react-sdk/pull/90)). Contributed by @t3chguy.
* Ensure timeline search results are visible even in video rooms ([#96](https://github.com/element-hq/matrix-react-sdk/pull/96)). Contributed by @t3chguy.
* Pop right panel timeline when unmaximising widget to avoid double timeline ([#94](https://github.com/element-hq/matrix-react-sdk/pull/94)). Contributed by @t3chguy.
* Fix accessible label on left panel spotlight trigger ([#87](https://github.com/element-hq/matrix-react-sdk/pull/87)). Contributed by @t3chguy.
* Crypto: fix display of device key ([#86](https://github.com/element-hq/matrix-react-sdk/pull/86)). Contributed by @richvdh.
Changes in [1.11.79](https://github.com/element-hq/element-desktop/releases/tag/v1.11.79) (2024-10-01)
======================================================================================================
* No changes
## ✨ Features
* [Backport staging] Allow joining calls and video rooms without enabling the labs flags ([#106](https://github.com/element-hq/matrix-react-sdk/pull/106)). Contributed by @RiotRobot.
Changes in [1.11.78](https://github.com/element-hq/element-desktop/releases/tag/v1.11.78) (2024-09-24)
======================================================================================================
* No changes
## ✨ Features
* Add Release announcement for the pinning message list ([#46](https://github.com/element-hq/matrix-react-sdk/pull/46)). Contributed by @florianduros.
* Unlabs feature pinning ([#22](https://github.com/element-hq/matrix-react-sdk/pull/22)). Contributed by @florianduros.
* Add mobile registration ([#42](https://github.com/element-hq/matrix-react-sdk/pull/42)). Contributed by @langleyd.
* Add support for `org.matrix.cross_signing_reset` UIA stage flow ([#34](https://github.com/element-hq/matrix-react-sdk/pull/34)). Contributed by @t3chguy.
* Add timezone to user profile ([#20](https://github.com/element-hq/matrix-react-sdk/pull/20)). Contributed by @Half-Shot.
* Add config option to force verification ([#29](https://github.com/element-hq/matrix-react-sdk/pull/29)). Contributed by @dbkr.
* Reduce pinned message banner size ([#28](https://github.com/element-hq/matrix-react-sdk/pull/28)). Contributed by @florianduros.
* Enable message pinning labs by default ([#25](https://github.com/element-hq/matrix-react-sdk/pull/25)). Contributed by @florianduros.
* Remove release announcement of the new header ([#23](https://github.com/element-hq/matrix-react-sdk/pull/23)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Fix timeout type ([#40](https://github.com/element-hq/matrix-react-sdk/pull/40)). Contributed by @dbkr.
* Fix huge usage bandwidth and performance issue of pinned message banner. ([#37](https://github.com/element-hq/matrix-react-sdk/pull/37)). Contributed by @florianduros.
* Reverse order of pinned message list ([#19](https://github.com/element-hq/matrix-react-sdk/pull/19)). Contributed by @florianduros.
Changes in [1.11.77](https://github.com/element-hq/element-desktop/releases/tag/v1.11.77) (2024-09-10)
======================================================================================================
## Licensing
matrix-react-sdk is being forked by Element at https://github.com/element-hq/matrix-react-sdk. Contributions are licensed to Element under a CLA and made available under an AGPLv3.0 or GPLv3.0 license at your choice.
You can read more about this here:
https://matrix.org/blog/2024/08/heart-of-matrix/
https://element.io/blog/sustainable-licensing-at-element-with-agpl/
The Matrix.org Foundation copy of the project will be archived. We don't expect any changes are needed by system administrators. Any updates will be communicated via our usual announcements channels and we are striving to make this as seamless as possible.
## ✨ Features
* Add docs for widget container height option ([#27922](https://github.com/element-hq/element-web/pull/27922)). Contributed by @dbkr.
* Allow user to set timezone ([#12775](https://github.com/matrix-org/matrix-react-sdk/pull/12775)). Contributed by @Timshel.
* Implement download\_file in widget driver ([#12931](https://github.com/matrix-org/matrix-react-sdk/pull/12931)). Contributed by @weeman1337.
* Sort the pinning message list in the same order than the banner. By timeline order. ([#12937](https://github.com/matrix-org/matrix-react-sdk/pull/12937)). Contributed by @florianduros.
* Display pinned messages on a banner at the top of a room ([#12917](https://github.com/matrix-org/matrix-react-sdk/pull/12917)). Contributed by @florianduros.
* Add a config option to control the default widget container height ([#12893](https://github.com/matrix-org/matrix-react-sdk/pull/12893)). Contributed by @dbkr.
* RTE drafts ([#12674](https://github.com/matrix-org/matrix-react-sdk/pull/12674)). Contributed by @langleyd.
* Add thread information in pinned message list ([#12902](https://github.com/matrix-org/matrix-react-sdk/pull/12902)). Contributed by @florianduros.
* Add Pin/Unpin action in quick access of the message action bar ([#12897](https://github.com/matrix-org/matrix-react-sdk/pull/12897)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Fix read receipt animation ([#12923](https://github.com/matrix-org/matrix-react-sdk/pull/12923)). Contributed by @dbkr.
* Display the indicator even with one message in pinned message banner ([#12946](https://github.com/matrix-org/matrix-react-sdk/pull/12946)). Contributed by @florianduros.
* Always display last pinned message on the banner ([#12945](https://github.com/matrix-org/matrix-react-sdk/pull/12945)). Contributed by @florianduros.
* The pinned message banner or list are triggering 🎉 effect. ([#12944](https://github.com/matrix-org/matrix-react-sdk/pull/12944)). Contributed by @florianduros.
* Fix reply message truncation on 2 lines ([#12929](https://github.com/matrix-org/matrix-react-sdk/pull/12929)). Contributed by @florianduros.
* Fix pin/unpin slowness and non refresh from the message action bar ([#12934](https://github.com/matrix-org/matrix-react-sdk/pull/12934)). Contributed by @florianduros.
* Ignore desktop for minimum browser support. ([#12928](https://github.com/matrix-org/matrix-react-sdk/pull/12928)). Contributed by @florianduros.
Changes in [1.11.76](https://github.com/element-hq/element-desktop/releases/tag/v1.11.76) (2024-08-27)
======================================================================================================
## ✨ Features

View File

@@ -1,5 +1 @@
# Contributing code to element-desktop
Everyone is welcome to contribute code to element-desktop, provided that they are willing to license their contributions to Element under a [Contributor License Agreement](https://cla-assistant.io/element-hq/element-desktop) (CLA). This ensures that their contribution will be made available under an OSI-approved open-source license, currently licensed under Affero General Public License v3 (AGPLv3) or General Public License v3 (GPLv3) at your choice.
element-desktop follows the same pattern as element-web, please find more contributing guidelines at https://github.com/vector-im/element-web/blob/develop/CONTRIBUTING.md
Please read the element-web [contributing guide](https://github.com/element-hq/element-web/blob/develop/CONTRIBUTING.md).

View File

@@ -7,7 +7,7 @@
# Element Desktop
Element Desktop is a Matrix client for desktop platforms with Element Web at its core.
Element Desktop is a Matrix client for desktop platforms with Element Web at its core. You can directly run and manage the source code in this repository, available dual-licensed under an AGPL or GPL.
# First Steps
@@ -143,10 +143,6 @@ $PROFILE` in which case it becomes `Element-$PROFILE`, or it is using one of
the above created by a pre-1.7 install, in which case it will be `Riot` or
`Riot-$PROFILE`.
You may also specify a different path entirely for the `config.json` file by
providing the `--config $YOUR_CONFIG_JSON_FILE` to the process, or via the
`ELEMENT_DESKTOP_CONFIG_JSON` environment variable.
# Translations
To add a new translation, head to the [translating doc](https://github.com/vector-im/element-web/blob/develop/docs/translating.md).

View File

@@ -2,7 +2,7 @@
## Requirements to build native modules
We rely on Github Actions `windows-2022` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml).
We rely on Github Actions `windows-latest` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml).
If you want to build native modules, make sure that the following tools are installed on your system.

View File

@@ -12,6 +12,9 @@ import { flipFuses, FuseVersion, FuseV1Options } from "@electron/fuses";
* Passes $ED_SIGNTOOL_THUMBPRINT and $ED_SIGNTOOL_SUBJECT_NAME to
* build.win.signingHashAlgorithms and build.win.certificateSubjectName respectively if specified.
*
* On macOS:
* Passes $ED_NOTARYTOOL_TEAM_ID to build.mac.notarize.notarize if specified
*
* On Linux:
* Replaces spaces in the product name with dashes as spaces in paths can cause issues
* Removes libsqlcipher0 recommended dependency if env SQLCIPHER_BUNDLED is asserted.
@@ -174,6 +177,16 @@ if (process.env.ED_SIGNTOOL_SUBJECT_NAME && process.env.ED_SIGNTOOL_THUMBPRINT)
config.win.certificateSha1 = process.env.ED_SIGNTOOL_THUMBPRINT;
}
/**
* Allow specifying macOS notary team id via env var
* @param {string} process.env.ED_NOTARYTOOL_TEAM_ID
*/
if (process.env.ED_NOTARYTOOL_TEAM_ID) {
config.mac.notarize = {
teamId: process.env.ED_NOTARYTOOL_TEAM_ID,
};
}
/**
* Allow specifying nightly version via env var
* @param {string} process.env.ED_NIGHTLY

View File

@@ -51,9 +51,9 @@
"features": {
"threadsActivityCentre": true,
"feature_spotlight": true,
"feature_group_calls": true,
"feature_video_rooms": true,
"feature_element_call_video_rooms": true
"feature_element_call_video_rooms": true,
"feature_new_room_decoration_ui": true
},
"setting_defaults": {
"RustCrypto.staged_rollout_percent": 100

View File

@@ -47,13 +47,5 @@
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx",
"setting_defaults": {
"RustCrypto.staged_rollout_percent": 60
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_element_call_video_rooms": true
},
"element_call": {
"url": "https://call.element.io"
}
}

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";
@@ -30,11 +30,7 @@ export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: Dependency
},
);
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
code ? reject(code) : resolve();
});
});
}

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import childProcess from "child_process";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import childProcess from "child_process";
@@ -27,11 +27,7 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
stdio: "inherit",
});
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
code ? reject(code) : resolve();
});
});
@@ -46,11 +42,7 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
stdio: "inherit",
});
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
code ? reject(code) : resolve();
});
});
}

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import childProcess from "child_process";

View File

@@ -2,7 +2,7 @@
"name": "element-desktop",
"productName": "Element",
"main": "lib/electron-main.js",
"version": "1.11.85",
"version": "1.11.76",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"homepage": "https://element.io",
@@ -79,39 +79,38 @@
"@babel/core": "^7.18.10",
"@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6",
"@electron/asar": "3.2.10",
"@electron/asar": "^3.2.3",
"@electron/fuses": "^1.7.0",
"@mapbox/node-pre-gyp": "^1.0.11",
"@playwright/test": "1.48.0",
"@stylistic/eslint-plugin": "^2.9.0",
"@playwright/test": "1.46.1",
"@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1",
"@types/minimist": "^1.2.1",
"@types/node": "18.19.55",
"@types/node": "18.19.47",
"@types/pacote": "^11.1.1",
"@types/tar": "^6.1.3",
"@types/uuid": "^10.0.0",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"app-builder-lib": "25.1.8",
"chokidar": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"app-builder-lib": "24.13.3",
"chokidar": "^3.5.2",
"detect-libc": "^2.0.0",
"electron": "^32.0.0",
"electron-builder": "25.1.8",
"electron-builder-squirrel-windows": "25.1.8",
"electron-builder": "24.13.3",
"electron-builder-squirrel-windows": "24.13.3",
"electron-devtools-installer": "^3.2.0",
"eslint": "^8.26.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^2.0.1",
"eslint-plugin-unicorn": "^56.0.0",
"eslint-plugin-matrix-org": "^1.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"glob": "^11.0.0",
"knip": "^5.0.0",
"matrix-web-i18n": "^3.2.1",
"mkdirp": "^3.0.0",
"pacote": "^19.0.0",
"pacote": "^18.0.0",
"prettier": "^3.0.0",
"rimraf": "^6.0.0",
"tar": "^6.2.1",
@@ -123,7 +122,7 @@
"keytar": "^7.9.0"
},
"resolutions": {
"@types/node": "18.19.55",
"@types/node": "18.19.47",
"config-file-ts": "0.2.8-rc1"
}
}

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { defineConfig } from "@playwright/test";

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.48.1-jammy
FROM mcr.microsoft.com/playwright:v1.46.1-jammy
WORKDIR /work/element-desktop

View File

@@ -1,41 +0,0 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { resolve } from "node:path";
import { test, expect } from "../../element-desktop-test";
test.describe("App config options", () => {
test.describe("Should load custom config via env", () => {
test.slow();
test.use({
extraEnv: {
ELEMENT_DESKTOP_CONFIG_JSON: resolve(__dirname, "../..", "fixtures/custom-config.json"),
},
});
test("should launch and use configured homeserver", async ({ page }) => {
await page.locator("#matrixchat").waitFor();
await page.locator(".mx_Welcome").waitFor();
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
await page.getByText("Sign in").click();
await page.getByText("matrix.example.org", { exact: true }).waitFor();
});
});
test.describe("Should load custom config via argument", () => {
test.slow();
test.use({
extraArgs: ["--config", resolve(__dirname, "../..", "fixtures/custom-config.json")],
});
test("should launch and use configured homeserver", async ({ page }) => {
await page.locator("#matrixchat").waitFor();
await page.locator(".mx_Welcome").waitFor();
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
await page.getByText("Sign in").click();
await page.getByText("matrix.example.org", { exact: true }).waitFor();
});
});
});

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2022, 2023 The Matrix.org Foundation C.I.C.
Copyright 2022-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { test, expect } from "../../element-desktop-test";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2023 The Matrix.org Foundation C.I.C.
Copyright 2023, 2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { _electron as electron, test as base, expect as baseExpect, type ElectronApplication } from "@playwright/test";
@@ -11,16 +11,7 @@ import fs from "node:fs/promises";
import path from "node:path";
import os from "node:os";
interface Fixtures {
app: ElectronApplication;
tmpDir: string;
extraEnv: Record<string, string>;
extraArgs: string[];
}
export const test = base.extend<Fixtures>({
extraEnv: {},
extraArgs: [],
export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
// eslint-disable-next-line no-empty-pattern
tmpDir: async ({}, use) => {
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
@@ -28,7 +19,7 @@ export const test = base.extend<Fixtures>({
await use(tmpDir);
await fs.rm(tmpDir, { recursive: true });
},
app: async ({ tmpDir, extraEnv, extraArgs }, use) => {
app: async ({ tmpDir }, use) => {
const args = ["--profile-dir", tmpDir];
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
@@ -38,12 +29,9 @@ export const test = base.extend<Fixtures>({
}
const app = await electron.launch({
env: {
...process.env,
...extraEnv,
},
env: process.env,
executablePath,
args: [...args, ...extraArgs],
args,
});
app.process().stdout.pipe(process.stdout);

View File

@@ -1,10 +0,0 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.example.org"
},
"m.identity_server": {
"base_url": "https://identity.example.org"
}
}
}

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -2,7 +2,7 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
declare module "@mapbox/node-pre-gyp/lib/util/versioning" {

View File

@@ -28,7 +28,7 @@ async function downloadToFile(url: string, filename: string): Promise<void> {
console.error(e);
try {
await fs.unlink(filename);
} catch {}
} catch (_) {}
throw e;
}
}
@@ -150,14 +150,14 @@ async function main(): Promise<number | undefined> {
await fs.opendir(expectedDeployDir);
console.log(expectedDeployDir + "already exists");
haveDeploy = true;
} catch {}
} catch (e) {}
if (!haveDeploy) {
const outPath = path.join(pkgDir, filename);
try {
await fs.stat(outPath);
console.log("Already have " + filename + ": not redownloading");
} catch {
} catch (e) {
try {
await downloadToFile(url, outPath);
} catch (e) {
@@ -170,7 +170,7 @@ async function main(): Promise<number | undefined> {
try {
await fs.stat(outPath + ".asc");
console.log("Already have " + filename + ".asc: not redownloading");
} catch {
} catch (e) {
try {
await downloadToFile(url + ".asc", outPath + ".asc");
} catch (e) {
@@ -206,7 +206,7 @@ async function main(): Promise<number | undefined> {
await fs.stat(ASAR_PATH);
console.log(ASAR_PATH + " already present: removing");
await fs.unlink(ASAR_PATH);
} catch {}
} catch (e) {}
if (cfgDir.length) {
const configJsonSource = path.join(cfgDir, "config.json");

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { DependencyInfo } from "./dep";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { DependencyInfo } from "./dep";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2021 The Matrix.org Foundation C.I.C.
Copyright 2021-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import HakEnv from "./hakEnv";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import fsProm from "fs/promises";
@@ -18,7 +18,7 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
try {
const stats = await fsProm.stat(moduleInfo.moduleBuildDir);
haveModuleBuildDir = stats.isDirectory();
} catch {
} catch (e) {
haveModuleBuildDir = false;
}
@@ -41,11 +41,7 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
code ? reject(code) : resolve();
});
});

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { mkdirp } from "mkdirp";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";
@@ -31,9 +31,8 @@ async function main(): Promise<void> {
const prefix = path.join(__dirname, "..", "..");
let packageJson;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
packageJson = require(path.join(prefix, "package.json"));
} catch {
} catch (e) {
console.error("Can't find a package.json!");
process.exit(1);
}
@@ -70,9 +69,8 @@ async function main(): Promise<void> {
const hakJsonPath = path.join(prefix, "hak", dep, "hak.json");
let hakJson: Record<string, any>;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
hakJson = await require(hakJsonPath);
} catch {
} catch (e) {
console.error("No hak.json found for " + dep + ".");
console.log("Expecting " + hakJsonPath);
process.exit(1);

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";
@@ -24,7 +24,7 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
// Also we do this for each module which is unnecessary, but meh.
try {
await fsProm.stat(yarnrc);
} catch {
} catch (e) {
await fsProm.writeFile(
yarnrc,
// XXX: 1. This must be absolute, as yarn will resolve link directories
@@ -50,11 +50,7 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
code ? reject(code) : resolve();
});
});
@@ -67,11 +63,7 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
if (code) {
reject(code);
} else {
resolve();
}
code ? reject(code) : resolve();
});
});
}

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2021 The Matrix.org Foundation C.I.C.
Copyright 2021-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { GLIBC, MUSL, familySync as processLibC } from "detect-libc";

View File

@@ -12,7 +12,7 @@ import * as childProcess from "child_process";
export async function versionFromAsar(): Promise<string> {
try {
await fs.stat("webapp.asar");
} catch {
} catch (e) {
throw new Error("No 'webapp.asar' found. Run 'yarn run fetch'");
}

View File

@@ -2,7 +2,7 @@
Copyright 2021-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { BrowserWindow } from "electron";

View File

@@ -2,7 +2,7 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
declare module "matrix-seshat" {

View File

@@ -2,7 +2,7 @@
Copyright 2023, 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { Streams } from "electron";

View File

@@ -1,11 +1,11 @@
/*
Copyright 2018-2024 New Vector Ltd.
Copyright 2017-2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2016 Aviral Dasgupta
Copyright 2016-2024 Aviral Dasgupta
Copyright 2016 OpenMarket Ltd
Copyright 2017-2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2018-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
// Squirrel on windows starts the app with various flags as hooks to tell us when we've been installed/uninstalled etc.
@@ -44,10 +44,6 @@ if (argv["help"]) {
console.log(" --profile-dir {path}: Path to where to store the profile.");
console.log(" --profile {name}: Name of alternate profile to use, allows for running multiple accounts.");
console.log(" --devtools: Install and use react-devtools and react-perf.");
console.log(
` --config: Path to the config.json file. May also be specified via the ELEMENT_DESKTOP_CONFIG_JSON environment variable.\n` +
` Otherwise use the default user location '${app.getPath("userData")}'`,
);
console.log(" --no-update: Disable automatic updating.");
console.log(" --hidden: Start the application hidden in the system tray.");
console.log(" --help: Displays this help message.");
@@ -55,8 +51,6 @@ if (argv["help"]) {
app.exit();
}
const LocalConfigLocation = process.env.ELEMENT_DESKTOP_CONFIG_JSON ?? argv["config"];
// Electron creates the user data directory (with just an empty 'Dictionaries' directory...)
// as soon as the app path is set, so pick a random path in it that must exist if it's a
// real user data directory.
@@ -103,7 +97,7 @@ async function tryPaths(name: string, root: string, rawPaths: string[]): Promise
try {
await afs.stat(p);
return p + "/";
} catch {}
} catch (e) {}
}
console.log(`Couldn't find ${name} files in any of: `);
for (const p of paths) {
@@ -143,7 +137,7 @@ async function loadConfig(): Promise<void> {
try {
global.vectorConfig = loadJsonFile(asarPath, "config.json");
} catch {
} catch (e) {
// it would be nice to check the error code here and bail if the config
// is unparsable, but we get MODULE_NOT_FOUND in the case of a missing
// file or invalid json, so node is just very unhelpful.
@@ -153,9 +147,7 @@ async function loadConfig(): Promise<void> {
try {
// Load local config and use it to override values from the one baked with the build
const localConfig = LocalConfigLocation
? loadJsonFile(LocalConfigLocation)
: loadJsonFile(app.getPath("userData"), "config.json");
const localConfig = loadJsonFile(app.getPath("userData"), "config.json");
// If the local config has a homeserver defined, don't use the homeserver from the build
// config. This is to avoid a problem where Riot thinks there are multiple homeservers
@@ -373,7 +365,7 @@ app.on("ready", async () => {
if (argv["devtools"]) {
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { default: installExt, REACT_DEVELOPER_TOOLS, REACT_PERF } = require("electron-devtools-installer");
installExt(REACT_DEVELOPER_TOOLS)
.then((name: string) => console.log(`Added Extension: ${name}`))

View File

@@ -55,7 +55,6 @@
},
"window_menu": {
"bring_all_to_front": "Alles naar voren brengen",
"label": "Venster",
"zoom": "Zoom"
"label": "Venster"
}
}

View File

@@ -2,7 +2,7 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { app, autoUpdater, desktopCapturer, ipcMain, powerSaveBlocker, TouchBar, nativeImage } from "electron";
@@ -147,7 +147,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
if (ret === null) {
ret = await keytar?.getPassword("riot.im", `${args[0]}|${args[1]}`);
}
} catch {
} catch (e) {
// if an error is thrown (e.g. keytar can't connect to the keychain),
// then return null, which means the default pickle key will be used
ret = null;
@@ -159,7 +159,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
const pickleKey = await randomArray(32);
await keytar?.setPassword("element.io", `${args[0]}|${args[1]}`, pickleKey);
ret = pickleKey;
} catch {
} catch (e) {
ret = null;
}
break;
@@ -170,7 +170,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
// migrate from riot.im (remove once we think there will no longer be
// logins from the time of riot.im)
await keytar?.deletePassword("riot.im", `${args[0]}|${args[1]}`);
} catch {}
} catch (e) {}
break;
case "getDesktopCapturerSources":
ret = (await desktopCapturer.getSources(args[0])).map((source) => ({

View File

@@ -2,14 +2,14 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import type * as Keytar from "keytar"; // Hak dependency type
let keytar: typeof Keytar | undefined;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-var-requires
keytar = require("keytar");
} catch (e) {
if ((<NodeJS.ErrnoException>e).code === "MODULE_NOT_FOUND") {

View File

@@ -2,7 +2,7 @@
Copyright 2021-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import counterpart from "counterpart";

View File

@@ -2,7 +2,7 @@
Copyright 2023, 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { BrowserWindow } from "electron";
@@ -128,9 +128,14 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
height: 24px;
}
.mx_RoomView::before {
.mx_RoomView[data-room-header="new"]::before {
height: 13px;
}
.mx_RoomView[data-room-header="legacy"]::before {
height: 27px;
}
`);
}

View File

@@ -2,7 +2,7 @@
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { BrowserWindow, ipcMain, session } from "electron";
@@ -33,74 +33,39 @@ async function getAccessToken(window: BrowserWindow): Promise<string | undefined
});
}
/**
* Get the homeserver url
* This requires asking the renderer process for the homeserver url.
*/
async function getHomeserverUrl(window: BrowserWindow): Promise<string> {
return new Promise((resolve) => {
ipcMain.once("homeserverUrl", (_, homeserver) => {
resolve(homeserver);
});
window.webContents.send("homeserverUrl"); // ping now that the listener exists
});
}
export function setupMediaAuth(window: BrowserWindow): void {
session.defaultSession.webRequest.onBeforeRequest(async (req, callback) => {
// This handler emulates the element-web service worker, where URLs are rewritten late in the request
// for backwards compatibility. As authenticated media becomes more prevalent, this should be replaced
// by the app using authenticated URLs from the outset.
try {
const url = new URL(req.url);
if (
!url.pathname.startsWith("/_matrix/media/v3/download") &&
!url.pathname.startsWith("/_matrix/media/v3/thumbnail")
) {
return callback({}); // not a URL we care about
}
let url = req.url;
if (!url.includes("/_matrix/media/v3/download") && !url.includes("/_matrix/media/v3/thumbnail")) {
return callback({}); // not a URL we care about
}
const supportedVersions = await getSupportedVersions(window);
// We have to check that the access token is truthy otherwise we'd be intercepting pre-login media request too,
// e.g. those required for SSO button icons.
const accessToken = await getAccessToken(window);
if (supportedVersions.includes("v1.11") && accessToken) {
url.href = url.href.replace(/\/media\/v3\/(.*)\//, "/client/v1/media/$1/");
return callback({ redirectURL: url.toString() });
} else {
return callback({}); // no support == no modification
}
} catch (e) {
console.error(e);
const supportedVersions = await getSupportedVersions(window);
// We have to check that the access token is truthy otherwise we'd be intercepting pre-login media request too,
// e.g. those required for SSO button icons.
const accessToken = await getAccessToken(window);
if (supportedVersions.includes("v1.11") && accessToken) {
url = url.replace(/\/media\/v3\/(.*)\//, "/client/v1/media/$1/");
return callback({ redirectURL: url });
} else {
return callback({}); // no support == no modification
}
});
session.defaultSession.webRequest.onBeforeSendHeaders(async (req, callback) => {
try {
const url = new URL(req.url);
if (!url.pathname.startsWith("/_matrix/client/v1/media")) {
return callback({}); // invoke unmodified
}
// Is this request actually going to the homeserver?
// We don't combine this check with the one above on purpose.
// We're fetching the homeserver url through IPC and should do so
// as sparingly as possible.
const homeserver = await getHomeserverUrl(window);
const isRequestToHomeServer = homeserver && url.origin === new URL(homeserver).origin;
if (!isRequestToHomeServer) {
return callback({}); // invoke unmodified
}
// Only add authorization header to authenticated media URLs. This emulates the service worker
// behaviour in element-web.
const accessToken = await getAccessToken(window);
// `accessToken` can be falsy, but if we're trying to download media without authentication
// then we should expect failure anyway.
const headers = { ...req.requestHeaders, Authorization: `Bearer ${accessToken}` };
return callback({ requestHeaders: headers });
} catch (e) {
console.error(e);
if (!req.url.includes("/_matrix/client/v1/media")) {
return callback({}); // invoke unmodified
}
// Only add authorization header to authenticated media URLs. This emulates the service worker
// behaviour in element-web.
const accessToken = await getAccessToken(window);
// `accessToken` can be falsy, but if we're trying to download media without authentication
// then we should expect failure anyway.
const headers = { ...req.requestHeaders, Authorization: `Bearer ${accessToken}` };
return callback({ requestHeaders: headers });
});
}

View File

@@ -1,9 +1,8 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2018, 2019 , 2021 New Vector Ltd
Copyright 2018-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { ipcRenderer, contextBridge, IpcRendererEvent } from "electron";
@@ -28,7 +27,6 @@ const CHANNELS = [
"userDownloadAction",
"openDesktopCapturerSourcePicker",
"userAccessToken",
"homeserverUrl",
"serverSupportedVersions",
];

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2020-2024 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { app } from "electron";
@@ -50,7 +50,7 @@ function readStore(): Record<string, string> {
const s = fs.readFileSync(storePath, { encoding: "utf8" });
const o = JSON.parse(s);
return typeof o === "object" ? o : {};
} catch {
} catch (e) {
return {};
}
}

View File

@@ -2,7 +2,7 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { app, ipcMain } from "electron";
@@ -24,7 +24,7 @@ let SeshatRecovery: typeof SeshatRecoveryType;
let ReindexError: typeof ReindexErrorType;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-var-requires
const seshatModule = require("matrix-seshat");
Seshat = seshatModule.Seshat;
SeshatRecovery = seshatModule.SeshatRecovery;
@@ -60,17 +60,9 @@ async function getOrCreatePassphrase(key: string): Promise<string> {
}
const deleteContents = async (p: string): Promise<void> => {
try {
for (const entry of await afs.readdir(p)) {
const curPath = path.join(p, entry);
try {
await afs.unlink(curPath);
} catch (e) {
console.log("Error deleting a file in EventStore directory", e);
}
}
} catch (e) {
console.log("Error reading the files in EventStore directory", e);
for (const entry of await afs.readdir(p)) {
const curPath = path.join(p, entry);
await afs.unlink(curPath);
}
};
@@ -123,7 +115,10 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
// anyways so reindexing it is a waste of time.
if (userVersion === 0) {
await recoveryIndex.shutdown();
await deleteContents(eventStorePath);
try {
await deleteContents(eventStorePath);
} catch (e) {}
} else {
await recoveryIndex.reindex();
}
@@ -152,7 +147,9 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
break;
case "deleteEventIndex": {
await deleteContents(eventStorePath);
try {
await deleteContents(eventStorePath);
} catch (e) {}
break;
}
@@ -267,7 +264,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
else {
try {
ret = await eventIndex.loadCheckpoints();
} catch {
} catch (e) {
ret = [];
}
}

View File

@@ -2,7 +2,7 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import * as tray from "./tray";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2017 OpenMarket Ltd
Copyright 2017-2024 OpenMarket Ltd
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import path from "path";

View File

@@ -1,10 +1,10 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2017 Karl Glatz <karl@glatz.biz>
Copyright 2017-2024 Karl Glatz <karl@glatz.biz>
Copyright 2017 OpenMarket Ltd
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { app, Tray, Menu, nativeImage } from "electron";

View File

@@ -2,7 +2,7 @@
Copyright 2016-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { app, autoUpdater, ipcMain } from "electron";

View File

@@ -2,7 +2,7 @@
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import crypto from "crypto";

View File

@@ -1,9 +1,9 @@
/*
Copyright 2024 New Vector Ltd.
Copyright 2016 OpenMarket Ltd
Copyright 2016-2024 OpenMarket Ltd
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import { app, shell, Menu, MenuItem, MenuItemConstructorOptions } from "electron";

View File

@@ -2,7 +2,7 @@
Copyright 2021-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
Please see LICENSE in the repository root for full details.
*/
import {
@@ -176,18 +176,15 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
ev.preventDefault();
}
function cutCopyPasteSelectContextMenus(
params: ContextMenuParams,
webContents: WebContents,
): MenuItemConstructorOptions[] {
function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemConstructorOptions[] {
const options: MenuItemConstructorOptions[] = [];
if (params.misspelledWord) {
params.dictionarySuggestions.forEach((word) => {
options.push({
label: word,
click: () => {
webContents.replaceMisspelling(word);
click: (menuItem, browserWindow) => {
browserWindow?.webContents.replaceMisspelling(word);
},
});
});
@@ -197,8 +194,8 @@ function cutCopyPasteSelectContextMenus(
},
{
label: _t("right_click_menu|add_to_dictionary"),
click: () => {
webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
click: (menuItem, browserWindow) => {
browserWindow?.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
},
},
{
@@ -240,8 +237,8 @@ function cutCopyPasteSelectContextMenus(
return options;
}
function onSelectedContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
const items = cutCopyPasteSelectContextMenus(params, webContents);
function onSelectedContextMenu(ev: Event, params: ContextMenuParams): void {
const items = cutCopyPasteSelectContextMenus(params);
const popupMenu = Menu.buildFromTemplate(items);
// popup() requires an options object even for no options
@@ -249,12 +246,12 @@ function onSelectedContextMenu(ev: Event, params: ContextMenuParams, webContents
ev.preventDefault();
}
function onEditableContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
function onEditableContextMenu(ev: Event, params: ContextMenuParams): void {
const items: MenuItemConstructorOptions[] = [
{ role: "undo" },
{ role: "redo", enabled: params.editFlags.canRedo },
{ type: "separator" },
...cutCopyPasteSelectContextMenus(params, webContents),
...cutCopyPasteSelectContextMenus(params),
];
const popupMenu = Menu.buildFromTemplate(items);
@@ -289,9 +286,9 @@ export default (webContents: WebContents): void => {
if (params.linkURL || params.srcURL) {
onLinkContextMenu(ev, params, webContents);
} else if (params.selectionText) {
onSelectedContextMenu(ev, params, webContents);
onSelectedContextMenu(ev, params);
} else if (params.isEditable) {
onEditableContextMenu(ev, params, webContents);
onEditableContextMenu(ev, params);
}
});

2727
yarn.lock
View File

File diff suppressed because it is too large Load Diff