* Add tests for unread notification facilities
Add some tests to guarantee some consistency in `useUnreadNotifications` and
`RoomNotificationState`.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Add RoomNotifs#determineUnreadState
Intended as a singular replacement for the divergent implementations before.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Unify room unread state determination
Have both the class-based facility and the hook use the new unified logic in
`RoomNotifs#determineUnreadState`.
Addresses https://github.com/vector-im/element-web/issues/24229
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
---------
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* noImplicitAny fixes for MessageDiffUtils
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Add tests for MessageDiffUtils
Adds mostly snapshot tests for MessageDiffUtils to guarantee consistent
behavior.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Strict mode fixes for MessageDiffUtils
Gets `MessageDiffUtils` to pass under `tsc --strict`.
Fixes https://github.com/vector-im/element-web/issues/23665 - no longer errors,
though it still isn't correct.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Remove obsolete DiffDOM workaround
Workaround is no longer necessary as of DiffDOM 4.2.1
See https://github.com/fiduswriter/diffDOM/issues/90
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
---------
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* should open new 1:1 chat room after leaving the old one
Signed-off-by: Ahmad Kadri <ahmad.kadri@nordeck.net>
* change the copyright
* update the test
Signed-off-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com>
---------
Signed-off-by: Ahmad Kadri <ahmad.kadri@nordeck.net>
Signed-off-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com>
Co-authored-by: Oliver Sand <oliver.sand@nordeck.net>
Co-authored-by: Dominik Henneke <dominik.henneke@nordeck.net>
* Strict typechecking fixes for Base/Member/Avatar
Update the core avatar files to pass `--strict --noImplicitAny` typechecks.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Add tests for Base/Member/Avatar
More thoroughly test the core avatar files. Not necessarily the most thorough,
but an improvement.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Extract TextAvatar from BaseAvatar
Extracted the fallback/textual avatar into its own component.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Use standard HTML for non-image avatars
Firefox users with `resistFingerprinting` enabled were seeing random noise
for rooms and users without avatars. There's no real reason to use data
URLs to present flat colors.
This converts non-image avatars to inline blocks with background colors.
See https://github.com/vector-im/element-web/issues/23936
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Have pills use solid backgrounds rather than colored images
Similar to room and member avatars, pills now use colored pseudo-elements
rather than background images.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
---------
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* Support token authenticated registration
https://spec.matrix.org/v1.2/client-server-api/#token-authenticated-registration
Signed-off-by: Callum Brown <callum@calcuode.com>
* Backwards compatibility with unstable auth type
Some server installs are not updated to use the stable version
of the registration token authentication type, so also handle
the unstable version defined in MSC3231.
Signed-off-by: Callum Brown <callum@calcuode.com>
* Make LOGIN_TYPE public and readonly
Co-authored-by: Travis Ralston <travpc@gmail.com>
* Remove line related to skinning
Signed-off-by: Callum Brown <callum@calcuode.com>
* Change empty string to null
Signed-off-by: Callum Brown <callum@calcuode.com>
* Use "public"s for new code style
Signed-off-by: Callum Brown <callum@calcuode.com>
* Change input to AccessibleButton
Signed-off-by: Callum Brown <callum@calcuode.com>
* Add more detail regarding source of token
Signed-off-by: Callum Brown <callum@calcuode.com>
* Fix lint error
The text and button type will be the same every time
for registration tokens, unlike (possibly) for SSO.
Signed-off-by: Callum Brown <callum@calcuode.com>
* Change null back to ""
Due to the following warning when attempting to test:
> Warning: `value` prop on `input` should not be null.
> Consider using an empty string to clear the component or
> `undefined` for uncontrolled components.
Signed-off-by: Callum Brown <callum@calcuode.com>
* Disable submit button when no token entered
Signed-off-by: Callum Brown <callum@calcuode.com>
* Add test for registration tokens
Adapted from test/components/views/dialogs/InteractiveAuthDialog-test.tsx
Signed-off-by: Callum Brown <callum@calcuode.com>
* Fix linting errors
Signed-off-by: Callum Brown <callum@calcuode.com>
* Fix test for registration tokens
Signed-off-by: Callum Brown <callum@calcuode.com>
Signed-off-by: Callum Brown <callum@calcuode.com>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>