...
 
Commits (53)
......@@ -29,6 +29,7 @@
"test/url/urlsearchparams",
"test/cors",
"test/crypto",
"test/iframe/sandbox",
"test/json",
"test/network/fetch",
......
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)
......
......@@ -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).
......
# 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
}
}
```
......@@ -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.
......
{
"name": "riot-web",
"productName": "Riot",
"version": "1.6.5",
"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.2",
"matrix-react-sdk": "2.7.2",
"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",
......
......@@ -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', {
......
......@@ -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
......
......@@ -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.",
......
......@@ -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.",
......
{}
{
"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"
}
......@@ -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."
}
......@@ -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());
......
This diff is collapsed.
......@@ -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) {}
}
}
/*
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);
});
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.