Commit Graph

165 Commits (52172832d666b7ef13c56fd05167f496c2123e20)

Author SHA1 Message Date
Florian Duros 73b35104ba
Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in RoomView 2024-11-22 10:33:11 +01:00
Florian Duros c67e67af4e
Use new `CrytoApi.restoreKeyBackup` & `CrytoApi.restoreKeyBackupFromPassphrase` api (#28385)
* Use new `CrytoApi.restoreKeyBackup` & `CrytoApi.restoreKeyBackupFromPassprhase` api

* Use new `CrytoApi.restoreKeyBackup` api in `SetupEncryptionStore`

* Add tests to `RestoreKeyBackupDialog`
2024-11-13 10:32:06 +00:00
Florian Duros 386b782f2a
Remove "Upgrade your encryption" flow in `CreateSecretStorageDialog` (#28290)
* Remove "Upgrade your encryption" flow

* Rename and remove tests

* Remove `BackupTrustInfo`

* Get keybackup when bootstraping the secret storage.

* Update src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2024-10-30 11:22:05 +00:00
Florian Duros 6d0d237c79
Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SecurityRoomSettingsTab` (#28281) 2024-10-24 08:34:07 +00:00
David Baker 19ef3267c0
Refactor CreateCrossSigningDialog (#28218)
* Refactor CreateCrossSigningDialog

 * Converts CreateCrossSigningDialog to a functional component
 * Pulls logic out to its own class
 * Updates usage of deprecated cross signing bootstrap method on client to be on the crypto object and updates test to match

Moved from https://github.com/element-hq/matrix-react-sdk/pull/131

* Add mock here too

* Use the right mock

* Remove duplicate mock

* Stray jest mock line

* Un-move mocks

* tsdoc

* Typo

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>

---------

Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
2024-10-22 11:42:07 +00:00
Florian Duros 46d13921d0
First batch: remove deprecated calls on `MatrixClient` (#28207)
* Remove `initCrypto` mocking

* Remove `MatrixClient.downloadKeys` mocking

* Remove `MatrixClient.getStoredDevice` mocking

* Replace `MatrixClient.setGlobalBlacklistUnverifiedDevices` by `MatrixClient.CryptoApi.globalBlacklistUnverifiedDevices`

* Remove `MatrixClient.getStoredCrossSigningForUser` mocking

* Replace `MatrixClient.legacyDeviceVerification` by `MatrixClient.CryptoApi.requestDeviceVerification`

* Remove `MatrixClient.isCrossSigningReady` mock

* Replace `MatrixClient.bootstrapCrossSigning` by `MatrixClient.getCrypto.bootstrapCrossSigning`

* Replace `MatrixClient.getCryptoTrustCrossSignedDevices` by `MatrixClient.getCrypto.getTrustCrossSignedDevices`

* Replace `MatrixClient.hasSecretStorageKey` by `MatrixClient.SecretStorage.hasKey`

* Replace `MatrixClient.getDefaultSecretStorageKeyId` by `MatrixClient.SecretStorage.getDefaultKeyId`

* Remove `MatrixClient.encryptAndSendToDevices` call
2024-10-21 12:53:39 +01:00
Florian Duros b45b06edad
Remove `MatrixClient.requestVerification` call (#28216) 2024-10-21 10:47:00 +00:00
Florian Duros fad457362d
Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `ContentMessages.ts` (#28238) 2024-10-18 14:44:56 +00:00
Michael Telatynski 6c6bf811a6
Migrate to stylistic
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-18 14:34:01 +01:00
Florian Duros 1bb482f6f7
Replace `Matrix.getKeyBackupEnabled` by `MatrixClient.CryptoApi.getActiveSessionBackupVersion` (#28225)
* Migrating deprecated sync `MatrixClient.getKeyBackupEnabled` to async `MatrixClient.CryptoApi.getActiveSessionBackupVersion` in `NewRecoveryMethodDialog`.
Rewrite `NewRecoveryMethodDialog` into a functional component to make it easier to handle the new async method.

* Migrating deprecated sync `MatrixClient.getKeyBackupEnabled` to async `MatrixClient.CryptoApi.getActiveSessionBackupVersion` in `MatrixChat`.
2024-10-18 09:45:45 +00:00
Florian Duros 85d2bf3a04
Second batch: remove deprecated calls on `MatrixClient` (#28227)
* Replace `MatrixClient.forceDiscardSession` call by `MatrixClient.CryptoApi.forceDiscardSession`

* Remove `MatrixClient.scheduleAllGroupSessionsForBackup` mock
2024-10-18 07:51:53 +00:00
Florian Duros 7236953d07
Remove references to `MatrixClient.crypto` (#28204)
* Remove `VerificationExplorer`

* Remove `remakeolm` slash command

* Remove call to `crypto.cancelAndResendAllOutgoingKeyRequests`

* Remove crypto mock in `LoginWithQR-test.tsx`

* Remove `StopGadWidgetDriver.sendToDevice`

* Remove remaining mock
2024-10-17 08:50:44 +01:00
Florian Duros 571ada37a7
Replace `MatrixClient.isCryptoEnabled` by `MatrixClient.getCrypto` (#140)
* Replace `MatrixClient.isCryptoEnabled` by `MatrixClient.getCrypto`

* Cast `cryptoEnabled` as `boolean`

* Fix `MatrixChat-test`

(cherry picked from commit 950ab1940bfcea9443f03284f9175d319c13a44c)
2024-10-16 09:42:18 +01:00
Michael Telatynski f0ee7f7905
Merge matrix-react-sdk into element-web
Merge remote-tracking branch 'repomerge/t3chguy/repomerge' into t3chguy/repo-merge

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-15 15:32:09 +01:00
Michael Telatynski b084ff2313
Prepare for repo merge
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-15 11:35:21 +01:00
Florian Duros bce02634f7
Replace `MatrixClient.prepareToEncrypt` by `MatrixClient.getCrypto.prepareToEncrypt` (#146) 2024-10-15 07:50:38 +00:00
Florian Duros 3bc0439fd2
Replace `MatrixClient.checkSecretStorageKey` by `MatrixClient.SecretStorage.checkKey` (#142) 2024-10-14 15:08:42 +00:00
David Baker 3a59556749
Revert #124 and #135 (#139)
This seems to be causing a lot of weirdness, presumably because there's
another missing thing like in #135, but I don't know what it might be and
it feels like it might take a while to find. Backing these changes out
to fix develop while we sort it out.

Fixes https://github.com/element-hq/element-web/issues/28179
2024-10-10 14:08:43 +00:00
David Baker 5f113c4db0
Fix bell icons on room list hover being black squares (#135)
* Fix bell icons on room list hover being black squares

The EchoStore wasn't being set up and therefore missed the client being
injected.

Patch from @t3chguy.

* Fix tests

...by mocking out createClient so it doesn't try to start a real client.

* More mocks

* Don't need this anymore either
2024-10-09 22:44:10 +00:00
Richard van der Hoff be2c1fcf64
Add labs option to exclude unverified devices (#92)
Add a labs option which will, when set, switch into the "invisible crypto"
mode of refusing to send keys to, or decrypt messages from, devices that have
not been signed by their owner.
2024-09-30 10:29:14 +00:00
Richard van der Hoff 2e895da39f
Crypto: fix display of device key (#86)
* CryptographyPanel: fix display of device key

* CryptographPanel: Fix HTML nesting

you're not supposed to put <tr> directly inside <table>; doing so causes
warnings.

* Update tests
2024-09-24 15:48:37 +00:00
David Baker a701e3afd7
Add config option to force verification (#29)
* Add config option to force verification

If this is set, users will not have the option to skip verification
on login (they will still be able to reload and continue unverified,
currently). Default off.

* Test for complete security dialog

* I hadn't set up prettier
2024-09-11 20:55:00 +00:00
Florian Duros 03004a55fd
Change settings to true by default (#25) 2024-09-11 11:16:52 +00:00
David Langley 491f0cd08a
Change license (#13)
* Copyright headers 1

* Licence headers 2

* Copyright Headers 3

* Copyright Headers 4

* Copyright Headers 5

* Copyright Headers 6

* Copyright headers 7

* Add copyright headers for html and config file

* Replace license files and update package.json

* Update with CLA

* lint
2024-09-09 13:57:16 +00:00
David Baker 4751c52d82
Refactor the various email/phone management UI into a single component (#12884)
* Refactor the various email/phone management UI into a single component

These were basically the same component copied & pasted 3 times and
tweaked to match the behaviour of each case. This de-dupes them into
one component.

This all could really benefit from playwright tests, but would require
setting up a dummy ID server in the playwright tests. This is all legacy
pre-MAS stuff so its questionable whether its worth the effort.

* Basic test, remove old tests

* Use different text to confirm remove & put headers back

although the two texts are both 'Remove' in practice

* Remove string

This was never triggered anyway with sydent & synapse because they
don't seem to agree on what error to return. In any case, I think it
makes more sense for it to be consistent with the email path, ie. using
a dialog.

* Avoid nested forms

* Snapshots

* More snapshots

* Test the hs side

* Snapshots

* Test IS bind/revoke

* Test remove can be cancelled

* Test unvalidated cases & fix phone error

* Reset state between tests

* Import useState directly

* One more direct React import
2024-08-14 13:13:57 +00:00
Andrew Ferrazzutti a437c677bb
Support delayed events (MSC4140) for call widget (#12714)
The Widget API spec for delayed events is defined by MSC4157.

Also support "parent" delayed events, which were in a previous version
of MSC4140 and may be reintroduced or be part of a new MSC later.
2024-08-07 15:06:30 +00:00
Michael Telatynski f3ac6692da
Handle media download errors better (#12848)
* Handle media download errors better

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Add test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Show error if media download failed

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* More tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-07-31 14:07:59 +00:00
Timo 3c370c6cbc
Remove MatrixRTC realted import ES lint exceptions using a index.ts for matrixrtc (#12780)
* update restricted import rules for matrixrtc

* review

* upgrade matrix-js-sdk

* add missing import
2024-07-25 12:49:41 +00:00
Michael Telatynski 0fc1c53a8e
Iterate design of right panel empty state (#12796)
* Add reusable empty state for the right panel

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Improve coverage

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-07-19 17:17:40 +00:00
Richard van der Hoff 348000100a
Cleanup tasks in SecurityManager/SetupEncryptionStore (#12764)
* Remove call to no-op `checkOwnCrossSigningTrust`

this is a no-op on rust crypto

* inline `SecurityManager.isCachingAllowed`

Since https://github.com/matrix-org/matrix-react-sdk/pull/4789, this has just
been an obscure way to write a test of a local variable.

* Remove unused `CreateSecretStorageOpts.getKeyBackupPassphrase` parameter

This is unused on rust crypto (cf https://github.com/matrix-org/matrix-js-sdk/pull/4313)
2024-07-13 10:27:59 +00:00
David Baker cfa322cd62
New user profile UI in User Settings (#12548)
* New user profile UI in User Settings

Using new Edit In Place component.

* Show avatar upload error

* Fix avatar upload error

* Wire up errors & feedback for display name setting

* Implement avatar upload / remove progress toast

* Add 768px breakpoint

* Fix room profile display

* Update to released compund-web with required components / fixes

* Require compound-web 4.4.0

because we do need it

* Update snapshots

Because of course all the auto-generated IDs of unrelated things
have changed.

* Fix duplicate import

* Fix CSS comment

* Update snapshot

* Run all the tests so the ids stay the same

* Start of a test for ProfileSettings

* More tests

* Test that a toast appears

* Test ToastRack

* Update snapshots

* Add the usernamee control

* Fix playwright tests

 * New compound version for editinplace fixes
 * Fix useId to not just generate a constant ID
 * Use the label in the username component
 * Fix widths of test boxes
 * Update screenshots

* Put ^ back on compound-web version

* Split CSS for room & user profile settings

and name the components correspondingly

* Fix playwright test

* Update room settings screenshot

* Use original screenshot instead

* Fix styling of unrelated buttons

Needed to be added in other places otherwise the specificity changes.

Also put the old screenshots back.

* Add copyright year

* Fix copyright year
2024-06-06 13:56:38 +00:00
Michael Telatynski 1677ed1be0
MSC4108 support OIDC QR code login (#12370)
Co-authored-by: Hugh Nimmo-Smith <hughns@matrix.org>
2024-06-06 09:57:28 +01:00
Michael Telatynski 148a360598
Avoid using deprecated exports, fields, and duplicate code (#12555) 2024-05-28 08:41:20 +01:00
Michael Telatynski 113c365563
Stop using deprecated methods, fields & exports (#12524)
* Remove legacy `threepidCreds` field

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove `user` field legacy UIA fallback

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update imports

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix test

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-05-15 14:58:28 +00:00
Florian Duros febb60ee45
Tooltip: improve accessibility for call and voice messages (#12489)
* Move to `AccessibilityButton`

* Update snapshots

* Add tests

* Update snapshots
2024-05-07 10:20:52 +00:00
David Baker 281916fd96
Take the Threads Activity Centre out of labs (#12439)
* Take the TAC out of labs!

Requires https://github.com/matrix-org/matrix-react-sdk/pull/12438
and ideally https://github.com/matrix-org/matrix-react-sdk/pull/12418

* i18n

* Add test method

That's needed now we we don't include threads in the notif count in the tests

* One less labs setting

* Update snapshot

* Disable release announcement

* Unused import

* Fix some screenshots

* Fix all the unread test cases now room unreads don't include threads

* Fix more tests

* Even more test fixes

* Still more test fixes

* Oh goodness, it's more test fixes

* Fix selectors now there are 2 buttons called Threads

* Disable some tests that aren't passing

for reasons that don't appear releated to any of the TAC work, as
per the comment.

* Remove debugging

* Oops, removed too much
2024-04-29 15:30:19 +00:00
Hubert Chathi 31373399f9
Add support for device dehydration v2 (#12316)
* rehydrate/dehydrate device if configured in well-known

* add handling for dehydrated devices

* some fixes

* schedule dehydration

* improve display of own dehydrated device

* created dehydrated device when creating or resetting SSSS

* some UI tweaks

* reorder strings

* lint

* remove statement for testing

* add playwright test

* lint and fix broken test

* update to new dehydration API

* some fixes from review

* try to fix test error

* remove unneeded debug line

* apply changes from review

* add Jest tests

* fix typo

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* don't need Object.assign

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2024-04-15 15:47:15 +00:00
David Baker 4ae94ae247
Mark all threads as read button (#12378)
* Mark all threads as read button

* Wrap in TooltipProvider and update snapshots

* Remove TooltipProvider wrapper: just add it to the test

* Add some more tests

* Add test for no-room-context handler because sonarcloud

* Add playwright test

* Make assertNoTacIndicator wait

* Use dedicated useMatrixClientContext function

Co-authored-by: Florian Duros <florianduros@element.io>

* Use dedicated useRoomContext function

Co-authored-by: Florian Duros <florianduros@element.io>

* Compound spacing variables

Co-authored-by: Florian Duros <florianduros@element.io>

* Compound spacing variables

Co-authored-by: Florian Duros <florianduros@element.io>

* Imports

* Use createTestClient()

* Add function to utils

* Use mkRoom

---------

Co-authored-by: Florian Duros <florianduros@element.io>
2024-03-28 17:38:21 +00:00
Timo 09f0d11e7f
Fix external guest access url for unencrypted rooms (#12345)
* use unencrypted calls in unencrypted rooms (make external call links compatible with unencrypted embedded calls)

Signed-off-by: Timo K <toger5@hotmail.de>

* use same logic in Call.ts

Signed-off-by: Timo K <toger5@hotmail.de>

* fix tests

Signed-off-by: Timo K <toger5@hotmail.de>

* fix test

Signed-off-by: Timo K <toger5@hotmail.de>

---------

Signed-off-by: Timo K <toger5@hotmail.de>
2024-03-28 12:25:00 +00:00
Timo a24aa7e0f7
Video call meta space (#12297)
* add video room meta space button

Signed-off-by: Timo K <toger5@hotmail.de>

* Add videoRoomsSpace to meta space configuration

Signed-off-by: Timo K <toger5@hotmail.de>

* temp

Signed-off-by: Timo K <toger5@hotmail.de>

* dont show ppl section in video room space

Signed-off-by: Timo K <toger5@hotmail.de>

* add i18n strings

Signed-off-by: Timo K <toger5@hotmail.de>

* revert waitForIframe=false (this is part of another PR)

Signed-off-by: Timo K <toger5@hotmail.de>

* fix missing mock room method

Signed-off-by: Timo K <toger5@hotmail.de>

* test snapshot: add video room meta space

Signed-off-by: Timo K <toger5@hotmail.de>

* rename Conferences -> Conference

Signed-off-by: Timo K <toger5@hotmail.de>

* space panel snap test

Signed-off-by: Timo K <toger5@hotmail.de>

* update snapshot

Signed-off-by: Timo K <toger5@hotmail.de>

* fix test

Signed-off-by: Timo K <toger5@hotmail.de>

* add video room space tests

Signed-off-by: Timo K <toger5@hotmail.de>

* better logic

Signed-off-by: Timo K <toger5@hotmail.de>

* Add Video MetaSpace Test

Signed-off-by: Timo K <toger5@hotmail.de>

* make room join rule update reactive for the video room meta space

Signed-off-by: Timo K <toger5@hotmail.de>

* temp

Signed-off-by: Timo K <toger5@hotmail.de>

* fix description for meta space video room settings

Signed-off-by: Timo K <toger5@hotmail.de>

* tests

Signed-off-by: Timo K <toger5@hotmail.de>

* update snapshot

Signed-off-by: Timo K <toger5@hotmail.de>

* review

Signed-off-by: Timo K <toger5@hotmail.de>

* i18n

Signed-off-by: Timo K <toger5@hotmail.de>

* fix tests

Signed-off-by: Timo K <toger5@hotmail.de>

* put video meta space behind "feature_video_rooms" labs flag

Signed-off-by: Timo K <toger5@hotmail.de>

* review

Signed-off-by: Timo K <toger5@hotmail.de>

* update space store on RoomCreate state event

Signed-off-by: Timo K <toger5@hotmail.de>

* test for updating video room space on room type update

Signed-off-by: Timo K <toger5@hotmail.de>

* remove comment

Signed-off-by: Timo K <toger5@hotmail.de>

* also make knock join rule rooms part of the conference section

Signed-off-by: Timo K <toger5@hotmail.de>

---------

Signed-off-by: Timo K <toger5@hotmail.de>
2024-03-25 18:35:31 +00:00
Richard van der Hoff 64806d0490
Use test helpers from js-sdk for encrypted events (#12364)
* Use test helpers from js-sdk for encrypted events

Rather than gut-wrenching into the matrix-js-sdk, let's use the newly-exported
test helpers to generate encrypted events.

* Fix up
2024-03-22 15:48:29 +00:00
Andy Balaam d3c0435446 Adept KnownMembership imports for new location in types 2024-03-18 14:43:08 +00:00
Andy Balaam 34559d2a89 Adapt Membership usage for the change to an enum KnownMembership 2024-03-18 14:43:08 +00:00
Stanislav Demydiuk da99bad7b9 Introduce Membership type 2024-03-18 14:43:08 +00:00
Michael Telatynski e807457276
Use correct push rule to evaluate room-wide mentions (#12318)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-03-08 14:27:08 +00:00
Richard van der Hoff 91020b3d00
Remove references to internal js-sdk type `CryptoBackend` (#12321)
* Remove references to internal js-sdk type `CryptoBackend`

* Use `Paramteters` to avoid `ts-ignore`
2024-03-06 22:59:41 +00:00
Michael Telatynski 36c07be889
Fix OIDC delegated auth account url check (#12242)
* Fix OIDC delegated auth account url check

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update tests

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-02-13 09:11:50 +00:00
Valere f36b6035f4
Fix logout can take ages (#12191)
* Fix logout can take ages

* fix for of loop

* Add logout tests

* Unit test for logout behavior

* UserMenu tests update snapshot
2024-02-02 11:43:59 +00:00
Valere 0337bd1b0a
Set up key backup using non-deprecated APIs (2nd take) (#12098)
* Ensure backup settings in playwright

* Fix verification by pass causing backup reset

* fix force backup setup by default

* fix test

* clarify when we need to bootstrap

* jslint

* post merge fix

* post rebase missing files

* fix bad merge

* update test

* Fix import

* test user forgot passkey

* better usage of locator

* fix snapshot

* remove getDialogByTitle

* Update src/async-components/views/dialogs/security/CreateKeyBackupDialog.tsx

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* unneeded permission

* code review

* cleaning

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2024-01-10 10:34:03 +00:00
Valere 61070698cc
Revert "Set up key backup using non-deprecated APIs (#12005)" (#12102) 2024-01-04 13:11:28 +00:00