Commit Graph

47 Commits

Author SHA1 Message Date
Timo
c3edd3e25e
Enable lint rules for Promise handling to discourage misuse of them. (#2607)
* Enable lint rules for Promise handling to discourage misuse of them.
Squashed all of Hugh's commits into one.

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
2024-09-10 09:49:35 +02:00
fkwp
9add3e52c4 Update file headers copyright and change licence to AGPL-3.0-only 2024-09-06 10:22:13 +02:00
Robin
7bca541cb6
Perform dead code analysis with Knip (#2575)
* Install Knip

* Clarify an import that was confusing Knip

* Fix issues detected by Knip

Including cleaning up some unused code and dependencies, using a React hook that we unintentionally stopped using, and also adding some previously undeclared dependencies.

* Run dead code analysis in lint script and CI

---------

Co-authored-by: Timo <toger5@hotmail.de>
2024-08-28 02:06:57 +02:00
Robin
5eaabcf74d
Clean up our tests in preparation for the testing sprint (#2466)
* Fix coverage reporting

Codecov hasn't been working recently because Vitest doesn't report coverage by default.

* Suppress some noisy log lines

Closes https://github.com/element-hq/element-call/issues/686

* Store test files alongside source files

This way we benefit from not having to maintain the same directory structure twice, and our linters etc. will actually lint test files by default.

* Stop using Vitest globals

Vitest provides globals primarily to make the transition from Jest more smooth. But importing its functions explicitly is considered a better pattern, and we have so few tests right now that it's trivial to migrate them all.

* Remove Storybook directory

We no longer use Storybook.

* Configure Codecov

Add a coverage gate for all new changes and disable its comments.

* upgrade vitest

---------

Co-authored-by: Timo <toger5@hotmail.de>
2024-08-27 15:45:39 +02:00
Andrew Ferrazzutti
7449e1f6e4
Don't refer to MSC3779 explicitly in comment (#2533)
because other MSCs (like 3757) may allow @-prefixed state keys
2024-08-02 15:15:54 +00:00
Timo
f9323d8b2c
Add future related widget capabilities (#2505)
* add future related widget capabilities

* Update js sdk
2024-08-01 11:41:47 -04:00
Timo
f53ea75c94
Add DeviceMute widget action io.element.device_mute. (#2482)
* Add DeviceMute widget action `io.element.device_mute`.
This allows to send mute requests ("toWidget") and get the current mute state as a response.
And it will update the client about each change of mute states.

* review + better explanation

* review

* add comments

* use `useCallback`
2024-07-30 13:30:33 +02:00
Timo
72de8e066c
fix grammar (#2506) 2024-07-25 14:33:37 +02:00
Andrew Ferrazzutti
ca45067158
Let Element Call widget set session memberships (#2459)
Make Element Call widgets request permission to set device-specific
session membership state events.
2024-07-05 04:59:48 +09:00
Andrew Ferrazzutti
5a6eb7c573
Make widgets request the room creation event (#2457)
This allows the widget to check the room version, so it can know about
version-specific auth rules (namely MSC3779).
2024-07-05 04:57:45 +09:00
Timo
812ae2ce89
Load focus information from well known and use client config only as a fallback. (#2358)
* Load focus information from well known and use client config only as a fallback.

Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2024-06-19 16:41:52 +02:00
Timo
0ed7853958
Remove EventType.GroupCallPrefix from widget capabilities (#2399)
Its not used anymore.
2024-06-17 20:04:49 +02:00
Timo
5284479ece
Knocking support (#2281)
* Add joining with knock room creation flow.

Also add `WaitForInviteView` after knocking.
And appropriate error views when knock failed or gets rejected.

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

* Refactor encryption information.

We had lots of enums and booleans to describe the encryption situation.
Now we only use the `EncryptionSystem` "enum" which contains the
additional information like sharedKey. (and we don't use the isRoomE2EE
function that is somewhat confusing since it checks `return widget ===
null && !room.getCanonicalAlias();` which is only indirectly related to
e2ee)

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

* Update recent list.

- Don't use deprecated `groupCallEventHander` anymore (it used the old
  `m.call` state event.)
- make the recent list reactive (getting removed from a call removes the
  item from the list)
- support having rooms without shared secret but actual matrix
  encryption in the recent list
- change the share link creation button so that we create a link with
  pwd for sharedKey rooms and with `perParticipantE2EE=true` for matrix
  encrypted rooms.

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

* fix types

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

* patch js-sdk for linter

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

* ignore ts expect error

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

* Fix error in widget mode.

We cannot call client.getRoomSummary in widget mode. The code path needs
to throw before reaching this call. (In general we should never call
getRoomSummary if getRoom returns a room)

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

* tempDemo

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

* remove wait for invite view

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

* yarn i18n

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

* reset back mute participant count

* add logic to show error view when getting removed

* include reason whenever someone gets removed from a call.

* fix activeRoom not beeing early enough

* fix lints

* add comment about encryption situation

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

* Fix lockfile

* Use (unmerged!) RoomSummary type from the js-sdk

Temporarily change the js-sdk dependency to the PR branch that provides
that type

* review

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

* review (remove participant count unknown)

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

* remove error for unencrypted calls (allow intentional unencrypted calls)

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

* update js-sdk

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

---------

Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Andrew Ferrazzutti <andrewf@element.io>
2024-04-23 22:15:13 +09:00
Timo
c932dd8c9b
Theme loading without flickering (#2233) 2024-03-13 14:58:21 +01:00
David Baker
731f1e4008
Merge pull request #1772 from vector-im/dbkr/ppe2ee
Support key-per-participant e2ee
2023-10-31 20:08:05 +00:00
Timo
441ad5bf2c
Fix not hanging up when using the close button (EXA EXI) (#1840)
---------

Signed-off-by: Timo K <toger5@hotmail.de>
2023-10-30 17:30:30 +01:00
David Baker
ba999e7bc3 Update event name 2023-10-18 15:27:44 +01:00
David Baker
15d3e7574d Re-apply Simon's emebdded e2ee work on latest livekit branch
Replaces https://github.com/vector-im/element-call/pull/1350
2023-10-16 17:45:06 +01:00
Robin
614bc82402 Format code 2023-10-11 10:42:04 -04:00
Robin
cc6f1f8631 Merge branch 'livekit' into eslint-upgrade 2023-10-11 10:30:57 -04:00
Timo
01b2367f38
allow widget related params in the fragment (#1675)
Signed-off-by: Timo K <toger5@hotmail.de>
2023-10-03 21:35:28 +02:00
Robin
a7624806b2 Upgrade eslint-plugin-matrix-org to 1.2.1
This upgrade came with a number of new lints that needed to be fixed across the code base. Primarily: explicit return types on functions, and explicit visibility modifiers on class members.
2023-09-22 18:07:06 -04:00
David Baker
4f48751aa2 Small refactor of URLParams stuff
Splits out the room locartion parsing from everything else to avoid
one function that fills out different parts of its return struct
depending on its args.
2023-09-18 17:49:10 +01:00
David Baker
9efb15941c
Merge pull request #1348 from vector-im/dbkr/matrixrtcsession
Switch to the MatrixRTCSession layer in js-sdk
2023-09-12 16:33:02 +01:00
Timo
0a009a7b1c
disable turn servers in widget mode (#1396)
Signed-off-by: Timo K <toger5@hotmail.de>
2023-09-12 13:51:06 +02:00
David Baker
c516207199 Remove matrix-widget-api as a dep & remove livekit stuff from widget init
We'll always have matrix-widget-api as a dep through js-sdk so also
specifyin it ourselves just means we'll end up using a different version
when the js-sdk upgrade their copy and get wierd errors. We could add a
peerDependency if we really felt the need?
2023-08-23 10:12:09 +01:00
Robin Townsend
15348fb43c Disable full mesh in widget mode
We disabled full mesh on the client that's used in SPA mode, but forgot to do the same for the widget mode client.
2023-08-09 18:02:05 -04:00
David Baker
f28cf0ce69 Fix embedded mode
This was trying to get the room alias, which causes the config to be
read. We don't need the room alias here though, so pass the flag to
not return it.
2023-07-17 19:16:28 +01:00
David Baker
e264a71d1e Merge v0.4.2 hotfixes 2023-07-12 17:57:54 +01:00
David Baker
f6383fb4b5 Add comment 2023-07-10 16:04:06 +01:00
David Baker
4c6535243d Fix types 2023-07-10 15:54:04 +01:00
David Baker
ca0e843d80 Add the livekit URL in matroyshka mode
This is a bit of a hack, as commented. The way to make it less of a
hack is there too.

Fixes embedded mode, although users will get a permission prompt
without https://github.com/matrix-org/matrix-react-sdk/pull/11209.

Fixes https://github.com/vector-im/element-call/issues/1201
2023-07-10 13:36:07 +01:00
Robin Townsend
45915ed67e Fix device selection never completing in widget mode
By reinstating some of the code from the full mesh branch that was there to handle this
2023-06-23 14:17:51 -04:00
Robin Townsend
ab97f12947 Merge branch 'main' into livekit-experiment 2023-06-09 17:22:34 -04:00
Robin Townsend
5ef0486eff Add a URL parameter for allowing fallback ICE servers 2023-06-05 15:52:05 -04:00
Daniel Abramov
b11ab01bbe Remove the unused exports with help of ts-prune 2023-06-05 19:11:38 +02:00
alariej
58d87db55f Add e2eEnabled parameter to Widget client 2023-03-01 14:30:25 +01:00
Robin Townsend
44e22e2684 Don't start new calls in widget mode
In widget mode, it's the client's duty to start the call.
2022-11-29 15:47:39 -05:00
Robin Townsend
2b74c2d9ce Merge branch 'main' into matryoshka-rageshake 2022-10-24 13:59:35 -04:00
Robin Townsend
9bdd5b0e58 Make rageshake requests work in matryoshka mode 2022-10-24 12:30:30 -04:00
David Baker
71dcc94166 Fix screen sharing
* Make the embedded mode screen sharing a request-each-way rather
   than request-and-reply, since replies time out and so can't wait
   for the user.
 * Try normal screen sharing first, then fall back to using the widget
   API if it fails (for lack of a good way of detecting when we
   should be using the widget API).

Fixes https://github.com/vector-im/element-call/issues/649
2022-10-21 20:19:52 +01:00
Šimon Brandner
4ee6e450b7
Make Element Call screensharing work on desktop
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2022-10-20 19:07:27 +02:00
Robin Townsend
43f98e6be6 yarn prettier:format 2022-10-17 09:30:22 -04:00
Robin Townsend
70ba6c3c6b Make avatars work in matryoshka mode
The client just didn't have a homeserver URL to perform media queries against.
2022-10-17 01:46:44 -04:00
Robin Townsend
8524b9ecd6 Set up translation with i18next 2022-10-12 14:53:49 -04:00
Robin Townsend
fd18f2acdf Don't kill other sessions when running as a widget 2022-09-12 15:37:39 -04:00
Robin Townsend
f0045c9406 Initialize all widget-related things at the top level 2022-09-09 02:09:12 -04:00