Compare commits

...

58 Commits

Author SHA1 Message Date
Michael Telatynski
ee11f2eedc Fix loading-test for SSO plaf changes
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-29 14:28:45 +01:00
RiotRobot
42c6a26e9f v1.6.6 2020-06-23 15:26:55 +01:00
RiotRobot
abc4f42f83 Prepare changelog for v1.6.6 2020-06-23 15:26:55 +01:00
RiotRobot
b1c106e8b2 Upgrade matrix-react-sdk to 2.8.0 2020-06-23 15:20:43 +01:00
RiotRobot
ae7f354811 Upgrade matrix-js-sdk to 7.0.0 2020-06-23 15:20:24 +01:00
RiotRobot
d12f33fb58 v1.6.6-rc.1 2020-06-17 21:52:14 +01:00
RiotRobot
b954292e06 Prepare changelog for v1.6.6-rc.1 2020-06-17 21:52:13 +01:00
RiotRobot
d587a8e910 Upgrade matrix-react-sdk to 2.8.0-rc.1 2020-06-17 21:49:25 +01:00
RiotRobot
2c227f68d4 Upgrade matrix-js-sdk to 7.0.0-rc.1 2020-06-17 21:49:00 +01:00
J. Ryan Stinnett
098984dd26 Merge pull request #14067 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-06-17 15:54:35 +01:00
GardeniaFair
ad1d4cba43 Translated using Weblate (Spanish)
Currently translated at 100.0% (33 of 33 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/es/
2020-06-17 14:52:40 +00:00
Priit Jõerüüt
36851a2aa3 Translated using Weblate (Estonian)
Currently translated at 100.0% (33 of 33 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/et/
2020-06-16 19:26:15 +00:00
RiotRobot
59d37ec94b Reset matrix-react-sdk back to develop branch 2020-06-16 12:01:07 +01:00
RiotRobot
6558d6d828 Reset matrix-js-sdk back to develop branch 2020-06-16 12:00:53 +01:00
RiotRobot
754d849055 Merge branch 'master' into develop 2020-06-16 12:00:14 +01:00
RiotRobot
d75045e852 v1.6.5 2020-06-16 11:53:53 +01:00
RiotRobot
fdec64f59c Prepare changelog for v1.6.5 2020-06-16 11:53:53 +01:00
RiotRobot
9ed7c96df6 Upgrade matrix-react-sdk to 2.7.2 2020-06-16 11:51:28 +01:00
RiotRobot
93da1f192b Upgrade matrix-js-sdk to 6.2.2 2020-06-16 11:51:11 +01:00
David Baker
657fa847c6 Merge pull request #14032 from RiotTranslateBot/weblate-riot-web-riot-web
Update from Weblate
2020-06-15 09:37:51 +01:00
Weblate
7a237e7045 Merge branch 'origin/develop' into Weblate. 2020-06-11 17:25:49 +00:00
Michael Telatynski
5900c7090f Merge pull request #13987 from vector-im/t3chguy/fix-decoder-ring
Attempt to fix decoder ring for relative hosted riots
2020-06-11 18:25:41 +01:00
Michael Telatynski
c32d3efd52 Add Base URL field to decoder-ring to make it more flexible
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-11 01:37:31 +01:00
Michael Telatynski
2419db5195 Attempt to fix decoder ring for relative hosted riots
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-11 01:24:26 +01:00
Nils Haugen
428f49bb7a Translated using Weblate (Norwegian Nynorsk)
Currently translated at 54.5% (18 of 33 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nn/
2020-06-09 20:29:25 +00:00
Slimane Selyan AMIRI
b9560c8cfc Translated using Weblate (Kabyle)
Currently translated at 18.2% (6 of 33 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/kab/
2020-06-09 20:29:25 +00:00
Nils Haugen
5b63be6a57 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 54.5% (18 of 33 strings)

Translation: Riot Web/riot-web
Translate-URL: https://translate.riot.im/projects/riot-web/riot-web/nn/
2020-06-08 13:29:22 +00:00
J. Ryan Stinnett
bf174e3f0f Merge pull request #13952 from vector-im/jryans/upgrade-deps-2020-06-05
Upgrade deps
2020-06-08 10:58:46 +01:00
J. Ryan Stinnett
7d800f9f38 Upgrade deps 2020-06-08 10:16:33 +01:00
Michael Telatynski
3bc6b08cad Merge pull request #13946 from vector-im/t3chguy/remember-updates
Fix riot-desktop manual update check getting stuck on Downloading...
2020-06-08 09:44:22 +01:00
Michael Telatynski
34dab73150 Fix riot-desktop manual update check getting stuck on Downloading...
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-07 13:19:29 +01:00
Travis Ralston
59cefb6ac8 Merge pull request #13943 from vector-im/dependabot/npm_and_yarn/websocket-extensions-0.1.4
Bump websocket-extensions from 0.1.3 to 0.1.4
2020-06-06 10:50:48 -06:00
dependabot[bot]
e8ebf886e4 Bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-06 13:56:59 +00:00
RiotRobot
6875ffe0d5 Reset matrix-react-sdk back to develop branch 2020-06-05 16:03:24 +01:00
RiotRobot
befc7589cd Reset matrix-js-sdk back to develop branch 2020-06-05 16:03:09 +01:00
RiotRobot
ca632fd2da Merge branch 'master' into develop 2020-06-05 16:02:34 +01:00
RiotRobot
4cf86fd50a Reset matrix-react-sdk back to develop branch 2020-06-04 15:39:07 +01:00
RiotRobot
88bb5a49ed Reset matrix-js-sdk back to develop branch 2020-06-04 15:38:53 +01:00
RiotRobot
5c5e7caacf Merge branch 'master' into develop 2020-06-04 15:38:19 +01:00
Michael Telatynski
bf35dd2b46 Merge pull request #13914 from vector-im/t3chguy/e2eedefault
Add e2ee-default:false docs
2020-06-04 13:12:22 +01:00
Michael Telatynski
bce0bf1b1d Apply suggestions from code review
Co-authored-by: J. Ryan Stinnett <jryans@gmail.com>
2020-06-04 12:38:45 +01:00
Michael Telatynski
cd829d3c1c Merge branches 'develop' and 't3chguy/e2eedefault' of github.com:vector-im/riot-web into t3chguy/e2eedefault 2020-06-03 22:19:03 +01:00
Michael Telatynski
faca8799db Add e2ee-default:false docs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-03 22:10:48 +01:00
Hubert Chathi
d86fd9e753 Merge pull request #13846 from vector-im/uhoreg/keytar
make IPC calls to get pickle key
2020-06-03 16:54:40 -04:00
Michael Telatynski
c75e888c90 Merge pull request #13913 from vector-im/t3chguy/sso-query
fix loading test for new sso pattern
2020-06-03 20:42:24 +01:00
Michael Telatynski
19ff8dde1f fix loading test for new sso pattern
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-03 20:35:56 +01:00
Michael Telatynski
801946782b Merge pull request #13889 from vector-im/t3chguy/sso-query
Fix login loop where the sso flow returns to `#/login`
2020-06-03 20:28:04 +01:00
Travis Ralston
5a77025dec Merge pull request #13905 from arthurlogilab/patch-1
Fix typo in docs
2020-06-03 07:47:00 -06:00
Arthur Lutz
d0413f0d15 [docs/config.md] typo fix 2020-06-03 14:59:34 +02:00
Michael Telatynski
d41fee06a1 Merge pull request #13904 from vector-im/t3chguy/remove_cross_signing
Remove cross-signing from labs
2020-06-03 13:42:01 +01:00
Michael Telatynski
bbe9a73266 Merge pull request #13890 from vector-im/t3chguy/pwa-platform
Add PWA Platform with PWA-specific badge controls
2020-06-03 11:19:45 +01:00
Michael Telatynski
c29dc0bad8 Remove cross-signing from labs
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-03 10:44:42 +01:00
Michael Telatynski
41738c322a Add PWA Platform with PWA-specific badge controls
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-02 16:58:05 +01:00
Michael Telatynski
d18b0f87d4 Fix login loop where the sso flow returns to #/login
due to fragmentAfterLogin going back to `#/login`
and https://github.com/vector-im/riot-web/issues/11643

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-06-02 16:26:08 +01:00
Michael Telatynski
3869a4d22e Merge pull request #13842 from vector-im/t3chguy/riotbot
Get rid of welcome.html's Chat with Riot Bot button
2020-06-02 13:58:49 +01:00
Michael Telatynski
d0679efe5d Merge pull request #13828 from vector-im/t3chguy/modernizr-subtleCrypto
Modernizr check for subtle crypto as we require it all over the place
2020-06-02 13:46:05 +01:00
Hubert Chathi
fb62f6dfb4 make IPC calls to get pickle key 2020-05-28 14:44:38 -04:00
Michael Telatynski
57d2026a40 Modernizr check for subtle crypto as we require it all over the place
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2020-05-28 00:31:22 +01:00
18 changed files with 1026 additions and 847 deletions

View File

@@ -29,6 +29,7 @@
"test/url/urlsearchparams",
"test/cors",
"test/crypto",
"test/iframe/sandbox",
"test/json",
"test/network/fetch",

View File

@@ -1,3 +1,49 @@
Changes in [1.6.6](https://github.com/vector-im/riot-web/releases/tag/v1.6.6) (2020-06-23)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.6-rc.1...v1.6.6)
* Upgrade to JS SDK 7.0.0 and React SDK 2.8.0
Changes in [1.6.6-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.6.6-rc.1) (2020-06-17)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.5...v1.6.6-rc.1)
* Upgrade to JS SDK 7.0.0-rc.1 and React SDK 2.8.0-rc.1
* Update from Weblate
[\#14067](https://github.com/vector-im/riot-web/pull/14067)
* Update from Weblate
[\#14032](https://github.com/vector-im/riot-web/pull/14032)
* Attempt to fix decoder ring for relative hosted riots
[\#13987](https://github.com/vector-im/riot-web/pull/13987)
* Upgrade deps
[\#13952](https://github.com/vector-im/riot-web/pull/13952)
* Fix riot-desktop manual update check getting stuck on Downloading...
[\#13946](https://github.com/vector-im/riot-web/pull/13946)
* Bump websocket-extensions from 0.1.3 to 0.1.4
[\#13943](https://github.com/vector-im/riot-web/pull/13943)
* Add e2ee-default:false docs
[\#13914](https://github.com/vector-im/riot-web/pull/13914)
* make IPC calls to get pickle key
[\#13846](https://github.com/vector-im/riot-web/pull/13846)
* fix loading test for new sso pattern
[\#13913](https://github.com/vector-im/riot-web/pull/13913)
* Fix login loop where the sso flow returns to `#/login`
[\#13889](https://github.com/vector-im/riot-web/pull/13889)
* Fix typo in docs
[\#13905](https://github.com/vector-im/riot-web/pull/13905)
* Remove cross-signing from labs
[\#13904](https://github.com/vector-im/riot-web/pull/13904)
* Add PWA Platform with PWA-specific badge controls
[\#13890](https://github.com/vector-im/riot-web/pull/13890)
* Modernizr check for subtle crypto as we require it all over the place
[\#13828](https://github.com/vector-im/riot-web/pull/13828)
Changes in [1.6.5](https://github.com/vector-im/riot-web/releases/tag/v1.6.5) (2020-06-16)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.4...v1.6.5)
* Upgrade to JS SDK 6.2.2 and React SDK 2.7.2
Changes in [1.6.4](https://github.com/vector-im/riot-web/releases/tag/v1.6.4) (2020-06-05)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.3...v1.6.4)

View File

@@ -91,7 +91,7 @@ For a good example, see https://riot.im/develop/config.json.
call buttons - integration managers may use a different domain.
1. `enable_presence_by_hs_url`: The property key should be the URL of the homeserver
and its value defines whether to enable/disable the presence status display
from that homeserver. If no options are configurd, presence is shown for all
from that homeserver. If no options are configured, presence is shown for all
homeservers.
1. `disable_guests`: Disables guest access tokens and auto-guest registrations.
Defaults to false (guests are allowed).

16
docs/e2ee.md Normal file
View File

@@ -0,0 +1,16 @@
# End to end encryption by default
By default, Riot will create encrypted DM rooms if the user you are chatting with has keys uploaded on their account.
For private room creation, Riot will default to encryption on but give you the choice to opt-out.
## Disabling encryption by default
Set the following on your homeserver's
`/.well-known/matrix/client` config:
```json
{
"im.vector.riot.e2ee": {
"default": false
}
}
```

View File

@@ -72,22 +72,6 @@ An implementation of [MSC2241](https://github.com/matrix-org/matrix-doc/pull/224
This also includes a new implementation of the user & member info panel, designed to share more code between showing community members & room members. Built on top of this new panel is also a new UX for verification from the member panel.
## Cross-signing
Cross-signing ([MSC1756](https://github.com/matrix-org/matrix-doc/pull/1756))
improves the device verification experience by allowing you to verify a user
instead of verifying each of their devices.
The feature is enabled by default and does not follow a traditional labs flag
at the moment. If something goes wrong, add this to your config to disable it:
```json
{
"settingDefaults": {
"feature_cross_signing": false
}
}
```
The setting will be removed in a future release, enabling it non-optionally for
all users.

View File

@@ -1,7 +1,7 @@
{
"name": "riot-web",
"productName": "Riot",
"version": "1.6.4",
"version": "1.6.6",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -60,8 +60,8 @@
"browser-request": "^0.3.3",
"gfm.css": "^1.1.2",
"highlight.js": "^9.13.1",
"matrix-js-sdk": "6.2.1",
"matrix-react-sdk": "2.7.1",
"matrix-js-sdk": "7.0.0",
"matrix-react-sdk": "2.8.0",
"olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz",
"postcss-easings": "^2.0.0",
"prop-types": "^15.7.2",

View File

@@ -4,8 +4,8 @@ class StartupError extends Error {}
* We need to know the bundle path before we can fetch the sourcemap files. In a production environment, we can guess
* it using this.
*/
async function getBundleName() {
const res = await fetch("../index.html");
async function getBundleName(baseUrl) {
const res = await fetch(new URL("index.html", baseUrl).toString());
if (!res.ok) {
throw new StartupError(`Couldn't fetch index.html to prefill bundle; ${res.status} ${res.statusText}`);
}
@@ -25,7 +25,7 @@ function validateBundle(value) {
* The purpose of this is just to validate that the user entered a real bundle, and provide feedback.
*/
const bundleCache = new Map();
function bundleSubject(bundle) {
function bundleSubject(baseUrl, bundle) {
if (!bundle.match(/^[0-9a-f]{20}$/)) throw new Error("Bad input");
if (bundleCache.has(bundle)) {
return bundleCache.get(bundle);
@@ -33,7 +33,7 @@ function bundleSubject(bundle) {
const fetcher = new rxjs.BehaviorSubject(Pending.of());
bundleCache.set(bundle, fetcher);
fetch(`/bundles/${bundle}/bundle.js.map`).then((res) => {
fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => {
res.body.cancel(); /* Bail on the download immediately - it could be big! */
const status = res.ok;
if (status) {
@@ -145,6 +145,7 @@ function ProgressBar({ fetchStatus }) {
* The main component.
*/
function BundlePicker() {
const [baseUrl, setBaseUrl] = React.useState(new URL("..", window.location).toString());
const [bundle, setBundle] = React.useState("");
const [file, setFile] = React.useState("");
const [line, setLine] = React.useState("1");
@@ -153,19 +154,25 @@ function BundlePicker() {
const [bundleFetchStatus, setBundleFetchStatus] = React.useState(None);
const [fileFetchStatus, setFileFetchStatus] = React.useState(None);
/* At startup, try to fill in the bundle name for the user */
/* On baseUrl change, try to fill in the bundle name for the user */
React.useEffect(() => {
getBundleName().then((name) => {
console.log("DEBUG", baseUrl);
getBundleName(baseUrl).then((name) => {
console.log("DEBUG", name);
if (bundle === "" && validateBundle(name) !== None) {
setBundle(name);
}
}, console.log.bind(console));
}, []);
}, [baseUrl]);
/* ------------------------- */
/* Follow user state changes */
/* ------------------------- */
const onBaseUrlChange = React.useCallback((event) => {
const value = event.target.value;
setBaseUrl(value);
}, []);
const onBundleChange = React.useCallback((event) => {
const value = event.target.value;
setBundle(value);
@@ -195,14 +202,14 @@ function BundlePicker() {
React.useEffect(() =>
validateBundle(bundle).fold({
some: (value) => {
const subscription = bundleSubject(value)
const subscription = bundleSubject(baseUrl, value)
.pipe(rxjs.operators.map(Some.of))
.subscribe(setBundleFetchStatus);
return () => subscription.unsubscribe();
},
none: () => setBundleFetchStatus(None),
}),
[bundle]);
[baseUrl, bundle]);
/* Whenever a valid javascript file is input, see if it corresponds to a sourcemap file and initiate a fetch
* if so. */
@@ -211,7 +218,7 @@ function BundlePicker() {
setFileFetchStatus(None);
return;
}
const observable = fetchAsSubject(`/bundles/${bundle}/${file}.map`)
const observable = fetchAsSubject(new URL(`bundles/${bundle}/${file}.map`, baseUrl).toString())
.pipe(
rxjs.operators.map((fetchStatus) => fetchStatus.flatMap(value => {
try {
@@ -224,7 +231,7 @@ function BundlePicker() {
);
const subscription = observable.subscribe(setFileFetchStatus);
return () => subscription.unsubscribe();
}, [bundle, file]);
}, [baseUrl, bundle, file]);
/*
* Whenever we have a valid fetched sourcemap, and a valid line, attempt to find the original position from the
@@ -255,6 +262,16 @@ function BundlePicker() {
/* ------ */
return e('div', {},
e('div', { className: 'inputs' },
e('div', { className: 'baseUrl' },
e('label', { htmlFor: 'baseUrl'}, 'Base URL'),
e('input', {
name: 'baseUrl',
required: true,
pattern: ".+",
onChange: onBaseUrlChange,
value: baseUrl,
}),
),
e('div', { className: 'bundle' },
e('label', { htmlFor: 'bundle'}, 'Bundle'),
e('input', {

View File

@@ -31,6 +31,12 @@ declare global {
// https://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger
InstallTrigger: any;
}
interface Navigator {
// PWA badging extensions https://w3c.github.io/badging/
setAppBadge?(count: number): Promise<void>;
clearAppBadge?(): Promise<void>;
}
}
// add method which is missing from the node typing

View File

@@ -16,7 +16,7 @@
"Room Directory": "Directorio de salas",
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "Puedes usar las opciones personalizadas del servidor para iniciar sesión en otros servidores Matrix, especificando la dirección URL del servidor. Esto te permite usar una cuenta Matrix en un servidor diferente.",
"Unexpected error preparing the app. See console for details.": "Error inesperado preparando la aplicación. Vea la consola para más detalles.",
"Your Riot is misconfigured": "Riot tiene un error de configuración",
"Your Riot is misconfigured": "Tu Riot está mal configurado",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuración errónea: sólo puede especificar uno de default_server_config, default_server_name, o default_hs_url.",
"Invalid configuration: no default server specified.": "Configuración errónea: no se ha especificado servidor.",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Tu configuración de Riot contiene JSON inválido. Por favor corrige el error y recarga la página.",

View File

@@ -2,7 +2,7 @@
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Sinu Rioti seadetes on vigane JSON. Palun, tee see korda ja laadi leht uuesti.",
"The message from the parser is: %(message)s": "Sõnum parserist on: %(message)s",
"Invalid JSON": "Vigane JSON",
"Your Riot is misconfigured": "Sinu Riot on valesti seadistatud",
"Your Riot is misconfigured": "Sinu Riot'i seadistused on paigast ära",
"Unknown device": "Tundmatu seade",
"Invalid configuration: no default server specified.": "Vigane seadistus: vaikimisi server on määramata.",
"Unable to load config file: please refresh the page to try again.": "Seadistuste faili laadimine ei õnnestunud: uuesti proovimiseks palun lae leht uuesti.",

View File

@@ -1 +1,9 @@
{}
{
"Invalid JSON": "JSON arameɣtu",
"Open user settings": "Ldi iɣewwaṛen n useqdac",
"Riot Desktop (%(platformName)s)": "Riot n tnarit (%(platformName)s)",
"Go to your browser to complete Sign In": "Ddu ɣer iminig akken ad tkemleḍ ajerred",
"Unknown device": "Ibenk arussin",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"Create Account": "Rnu amiḍan"
}

View File

@@ -15,11 +15,11 @@
"Need help?": "Treng du hjelp?",
"Explore rooms": "Utforsk romma",
"Room Directory": "Romkatalog",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Riot-konfigurasjonen din har ugyldig JSON-kode. Korriger dette og last inn sida på nytt.",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Riot-oppsettet ditt inneheld ugyldig JSON-kode. Korriger dette og last inn sida på nytt.",
"The message from the parser is: %(message)s": "Meldinga frå kodetolkaren er: %(message)s",
"Invalid JSON": "Ugyldig JSON",
"Your Riot is misconfigured": "Riot-klienten din er feilkonfiguert",
"Your Riot is misconfigured": "Riot-klienten din er sett opp feil",
"Unexpected error preparing the app. See console for details.": "Uventa feil under lasting av programmet. Sjå konsollen for detaljar.",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Ugyldig konfigurasjon: berre muleg å berre spesifiere ein av default_server_config, default_server_name eller default_hs_url.",
"Invalid configuration: no default server specified.": "Ugyldig konfigurasjon: \"default server\" er ikkje spesifisert."
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Ugyldig oppsett: berre muleg å berre spesifiere ein av default_server_config, default_server_name eller default_hs_url.",
"Invalid configuration: no default server specified.": "Ugyldig oppsett: ingen \"default server\" er spesifisert."
}

View File

@@ -26,6 +26,7 @@ import * as React from "react";
import * as languageHandler from "matrix-react-sdk/src/languageHandler";
import SettingsStore from "matrix-react-sdk/src/settings/SettingsStore";
import ElectronPlatform from "./platform/ElectronPlatform";
import PWAPlatform from "./platform/PWAPlatform";
import WebPlatform from "./platform/WebPlatform";
import PlatformPeg from "matrix-react-sdk/src/PlatformPeg";
import SdkConfig from "matrix-react-sdk/src/SdkConfig";
@@ -39,8 +40,10 @@ export const rageshakePromise = initRageshake();
export function preparePlatform() {
if (window.ipcRenderer) {
console.log("Using Electron platform");
const plaf = new ElectronPlatform();
PlatformPeg.set(plaf);
PlatformPeg.set(new ElectronPlatform());
} else if (window.matchMedia('(display-mode: standalone)').matches) {
console.log("Using PWA platform");
PlatformPeg.set(new PWAPlatform());
} else {
console.log("Using Web platform");
PlatformPeg.set(new WebPlatform());

File diff suppressed because one or more lines are too long

View File

@@ -44,7 +44,7 @@ import {randomString} from "matrix-js-sdk/src/randomstring";
import {Action} from "matrix-react-sdk/src/dispatcher/actions";
import {ActionPayload} from "matrix-react-sdk/src/dispatcher/payloads";
import {showToast as showUpdateToast} from "matrix-react-sdk/src/toasts/UpdateToast";
import { CheckUpdatesPayload } from 'matrix-react-sdk/src/dispatcher/payloads/CheckUpdatesPayload';
import {CheckUpdatesPayload} from "matrix-react-sdk/src/dispatcher/payloads/CheckUpdatesPayload";
const ipcRenderer = window.ipcRenderer;
const isMac = navigator.platform.toUpperCase().includes('MAC');
@@ -228,8 +228,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
rageshake.flush();
});
ipcRenderer.on('ipcReply', this._onIpcReply.bind(this));
ipcRenderer.on('update-downloaded', this.onUpdateDownloaded.bind(this));
ipcRenderer.on('ipcReply', this._onIpcReply);
ipcRenderer.on('update-downloaded', this.onUpdateDownloaded);
ipcRenderer.on('preferences', () => {
dis.fire(Action.ViewUserSettings);
@@ -275,11 +275,15 @@ export default class ElectronPlatform extends VectorBasePlatform {
return this._ipcCall('getConfig');
}
async onUpdateDownloaded(ev, {releaseNotes, releaseName}) {
onUpdateDownloaded = async (ev, {releaseNotes, releaseName}) => {
dis.dispatch<CheckUpdatesPayload>({
action: Action.CheckUpdates,
status: UpdateCheckStatus.Ready,
});
if (this.shouldShowUpdate(releaseName)) {
showUpdateToast(await this.getAppVersion(), releaseName, releaseNotes);
}
}
};
getHumanReadableName(): string {
return 'Electron Platform'; // no translation required: only used for analytics
@@ -426,7 +430,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
});
}
_onIpcReply(ev, payload) {
_onIpcReply = (ev, payload) => {
if (payload.id === undefined) {
console.warn("Ignoring IPC reply with no ID");
return;
@@ -444,7 +448,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
} else {
callbacks.resolve(payload.reply);
}
}
};
getEventIndexingManager(): BaseEventIndexManager | null {
return this.eventIndexManager;
@@ -500,4 +504,30 @@ export default class ElectronPlatform extends VectorBasePlatform {
return handled;
}
async getPickleKey(userId: string, deviceId: string): Promise<string | null> {
try {
return await this._ipcCall('getPickleKey', userId, deviceId);
} catch (e) {
// if we can't connect to the password storage, assume there's no
// pickle key
return null;
}
}
async createPickleKey(userId: string, deviceId: string): Promise<string | null> {
try {
return await this._ipcCall('createPickleKey', userId, deviceId);
} catch (e) {
// if we can't connect to the password storage, assume there's no
// pickle key
return null;
}
}
async destroyPickleKey(userId: string, deviceId: string): Promise<void> {
try {
await this._ipcCall('destroyPickleKey', userId, deviceId);
} catch (e) {}
}
}

View File

@@ -0,0 +1,29 @@
/*
Copyright 2020 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import WebPlatform from "./WebPlatform";
export default class PWAPlatform extends WebPlatform {
setNotificationCount(count: number) {
if (!navigator.setAppBadge) return super.setNotificationCount(count);
if (this.notificationCount === count) return;
this.notificationCount = count;
navigator.setAppBadge(count).catch(e => {
console.error("Failed to update PWA app badge", e);
});
}
}

View File

@@ -589,8 +589,8 @@ describe('loading:', function() {
describe('Token login:', function() {
it('logs in successfully', function() {
localStorage.setItem("mx_hs_url", "https://homeserver");
localStorage.setItem("mx_is_url", "https://idserver");
localStorage.setItem("mx_sso_hs_url", "https://homeserver");
localStorage.setItem("mx_sso_is_url", "https://idserver");
loadApp({
queryString: "?loginToken=secretToken",
});

1627
yarn.lock

File diff suppressed because it is too large Load Diff