Skip to content

Commit 99e5271

Browse files
committed
Merge branch 'develop' of github.com:vector-im/riot-web into t3chguy/poc_riot_desktop_sso_multi_profile
2 parents 15bb819 + c0b4ab9 commit 99e5271

28 files changed

Lines changed: 1516 additions & 958 deletions

‎docs/config.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ For a good example, see https://riot.im/develop/config.json.
8484
By default, this is "https://matrix.to" to generate matrix.to (spec) permalinks.
8585
Set this to your Riot instance URL if you run an unfederated server (eg:
8686
"https://riot.example.org").
87-
1. `jitsi`: Used to change the default conference options.
87+
1. `jitsi`: Used to change the default conference options. Learn more about the
88+
Jitsi options at [jitsi.md](./jitsi.md).
8889
1. `preferredDomain`: The domain name of the preferred Jitsi instance. Defaults
8990
to `jitsi.riot.im`. This is used whenever a user clicks on the voice/video
9091
call buttons - integration managers may use a different domain.

‎docs/jitsi-dev.md‎

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Jitsi wrapper developer docs
2+
3+
*If you're looking for information on how to set up Jitsi in your Riot, see
4+
[jitsi.md](./jitsi.md) instead.*
5+
6+
These docs are for developers wondering how the different conference buttons work
7+
within Riot. If you're not a developer, you're probably looking for [jitsi.md](./jitsi.md).
8+
9+
## Brief introduction to widgets
10+
11+
Widgets are embedded web applications in a room, controlled through state events, and
12+
have a `url` property. They are largely specified by [MSC1236](https://github.com/matrix-org/matrix-doc/issues/1236)
13+
and have extensions proposed under [MSC1286](https://github.com/matrix-org/matrix-doc/issues/1286).
14+
15+
The `url` is typically something we shove into an iframe with sandboxing (see `AppTile`
16+
in the react-sdk), though for some widgets special integration can be done. v2 widgets
17+
have a `data` object which helps achieve that special integration, though v1 widgets
18+
are best iframed and left alone.
19+
20+
Widgets have a `postMessage` API they can use to interact with Riot, which also allows
21+
Riot to interact with them. Typically this is most used by the sticker picker (an
22+
account-level widget), though widgets like the Jitsi widget will request permissions to
23+
get 'stuck' into the room list during a conference.
24+
25+
Widgets can be added with the `/addwidget <url>` command.
26+
27+
## Brief introduction to integration managers
28+
29+
Integration managers (like Scalar and Dimension) are accessible via the 4 squares in
30+
the top right of the room and provide a simple UI over top of bridges, bots, and other
31+
stuff to plug into a room. They are a separate service to Riot and are thus iframed
32+
in a dialog as well. They also have a `postMessage` API they can use to interact with
33+
the client to create things like widgets, give permissions to bridges, and generally
34+
set everything up for the integration the user is working with.
35+
36+
Integration managers do not currently have a spec associated with them, though efforts
37+
are underway in [MSC1286](https://github.com/matrix-org/matrix-doc/issues/1286).
38+
39+
## Widgets configured by integration managers
40+
41+
Integration managers will often "wrap" a widget by using a widget `url` which points
42+
to the integration manager instead of to where the user requested the widget be. For
43+
example, a custom widget added in an integration manager for https://matrix.org will
44+
end up creating a widget with a URL like `https://integrations.example.org?widgetUrl=https%3A%2F%2Fmatrix.org`.
45+
46+
The integration manager's wrapper will typically have another iframe to isolate the
47+
widget from the client by yet another layer. The wrapper often provides other functionality
48+
which might not be available on the embedded site, such as a fullscreen button or the
49+
communication layer with the client (all widgets *should* be talking to the client
50+
over `postMessage`, even if they aren't going to be using the widget APIs).
51+
52+
Widgets added with the `/addwidget` command will *not* be wrapped as they are not going
53+
through an integration manager. The widgets themselves *should* also work outside of
54+
Riot. Widgets currently have a "pop out" button which opens them in a new tab and
55+
therefore have no connection back to Riot.
56+
57+
## Jitsi widgets from integration managers
58+
59+
Integration managers will create an entire widget event and send it over `postMessage`
60+
for the client to add to the room. This means that the integration manager gets to
61+
decide the conference domain, conference name, and other aspects of the widget. As
62+
a result, users can end up with a Jitsi widget that does not use the same conference
63+
server they specified in their config.json - this is expected.
64+
65+
Some integration managers allow the user to change the conference name while others
66+
will generate one for the user.
67+
68+
## Jitsi widgets generated by Riot itself
69+
70+
When the user clicks on the call buttons by the composer, the integration manager is
71+
not involved in the slightest. Instead, Riot itself generates a widget event, this time
72+
using the config.json parameters, and publishes that to the room. If there's only two
73+
people in the room, a plain WebRTC call is made instead of using a widget at all - these
74+
are defined in the Matrix specification.
75+
76+
The Jitsi widget created by Riot uses a local `jitsi.html` wrapper (or one hosted by
77+
`https://riot.im/app` for desktop users or those on non-https domains) as the widget
78+
`url`. The wrapper has some basic functionality for talking to Riot to ensure the
79+
required `postMessage` calls are fulfilled.
80+
81+
**Note**: Per [jitsi.md](./jitsi.md) the `preferredDomain` can also come from the server's
82+
client .well-known data.
83+
84+
## The Jitsi wrapper in Riot
85+
86+
Whenever Riot sees a Jitsi widget, it ditches the `url` and instead replaces it with
87+
its local wrapper, much like what it would do when creating a widget. However, instead
88+
of using one from riot.im/app, it will use one local to the client instead.
89+
90+
The wrapper is used to provide a consistent experience to users, as well as being faster
91+
and less risky to load. The local wrapper URL is populated with the conference information
92+
from the original widget (which could be a v1 or v2 widget) so the user joins the right
93+
call.
94+
95+
Critically, when the widget URL is reconstructed it does *not* take into account the
96+
config.json's `preferredDomain` for Jitsi. If it did this, users would end up on different
97+
conference servers and therefore different calls entirely.
98+
99+
**Note**: Per [jitsi.md](./jitsi.md) the `preferredDomain` can also come from the server's
100+
client .well-known data.

‎docs/jitsi.md‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Jitsi in Riot
2+
3+
Riot uses [Jitsi](https://jitsi.org/) for conference calls, which provides options for
4+
self-hosting your own server and supports most major platforms.
5+
6+
1:1 calls, or calls between you and one other person, do not use Jitsi. Instead, those
7+
calls work directly between clients or via TURN servers configured on the respective
8+
homeservers.
9+
10+
There's a number of ways to start a Jitsi call: the easiest way is to click on the
11+
voice or video buttons near the message composer in a room with more than 2 people. This
12+
will add a Jitsi widget which allows anyone in the room to join.
13+
14+
Integration managers (available through the 4 squares in the top right of the room) may
15+
provide their own approaches for adding Jitsi widgets.
16+
17+
## Configuring Riot to use your self-hosted Jitsi server
18+
19+
Riot will use the Jitsi server that is embedded in the widget, even if it is not the
20+
one you configured. This is because conference calls must be held on a single Jitsi
21+
server and cannot be split over multiple servers.
22+
23+
However, you can configure Riot to *start* a conference with your Jitsi server by adding
24+
to your [config](./config.md) the following:
25+
```json
26+
{
27+
"jitsi": {
28+
"preferredDomain": "your.jitsi.example.org"
29+
}
30+
}
31+
```
32+
33+
The default is `jitsi.riot.im` (a free service offered by Riot), and the demo site for
34+
Jitsi uses `meet.jit.si` (also free).
35+
36+
Once you've applied the config change, refresh Riot and press the call button. This
37+
should start a new conference on your Jitsi server.
38+
39+
**Note**: The widget URL will point to a `jitsi.html` page hosted by Riot. The Jitsi
40+
domain will appear later in the URL as a configuration parameter.
41+
42+
**Hint**: If you want everyone on your homeserver to use the same Jitsi server by
43+
default, set the following on your homeserver's `/.well-known/matrix/client` config:
44+
```json
45+
{
46+
"im.vector.riot.jitsi": {
47+
"preferredDomain": "your.jitsi.example.org"
48+
}
49+
}
50+
```
51+
52+
## Mobile app support
53+
54+
Currently the Riot mobile apps do not support custom Jitsi servers and will instead
55+
use the default `jitsi.riot.im` server. When users on the mobile apps join the call,
56+
they will be joining a different conference which has the same name, but not the same
57+
participants. This is a known bug and which needs to be fixed.

‎electron_app/yarn.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,9 @@ minimist@0.0.8:
500500
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
501501

502502
minimist@^1.2.0:
503-
version "1.2.2"
504-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.2.tgz#b00a00230a1108c48c169e69a291aafda3aacd63"
505-
integrity sha512-rIqbOrKb8GJmx/5bc2M0QchhUouMXSpd1RTclXsB41JdL+VtnojfaJR+h7F9k18/4kHUsBFgk80Uk+q569vjPA==
503+
version "1.2.3"
504+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.3.tgz#3db5c0765545ab8637be71f333a104a965a9ca3f"
505+
integrity sha512-+bMdgqjMN/Z77a6NlY/I3U5LlRDbnmaAk6lDveAPKwSpcPM4tKAuYsvYF8xjhOPXhOYGe/73vVLVez5PW+jqhw==
506506

507507
mkdirp@0.5.1, mkdirp@^0.5.1:
508508
version "0.5.1"

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"@babel/preset-typescript": "^7.7.4",
9797
"@babel/register": "^7.7.4",
9898
"@babel/runtime": "^7.7.6",
99+
"@types/modernizr": "^3.5.3",
99100
"@types/react": "16.9",
100101
"@types/react-dom": "^16.9.4",
101102
"autoprefixer": "^9.7.3",
@@ -136,6 +137,7 @@
136137
"modernizr": "^3.6.0",
137138
"optimize-css-assets-webpack-plugin": "^5.0.3",
138139
"postcss-extend": "^1.0.5",
140+
"postcss-hexrgba": "^2.0.0",
139141
"postcss-import": "^12.0.1",
140142
"postcss-loader": "^3.0.0",
141143
"postcss-mixins": "^6.2.3",
Lines changed: 6 additions & 0 deletions
Loading

‎src/@types/global.d.ts‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,25 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
interface Window {
18-
Olm: {
19-
init: () => Promise<void>;
20-
};
21-
mxSendRageshake: (text: string, withLogs?: boolean) => void;
17+
import "modernizr";
18+
import {Renderer} from "react-dom";
19+
20+
declare global {
21+
interface Window {
22+
Modernizr: ModernizrAPI & FeatureDetects;
23+
Olm: {
24+
init: () => Promise<void>;
25+
};
26+
27+
mxSendRageshake: (text: string, withLogs?: boolean) => void;
28+
matrixChat: ReturnType<Renderer>;
29+
30+
// electron-only
31+
ipcRenderer: any;
32+
}
33+
34+
// workaround for https://github.com/microsoft/TypeScript/issues/30933
35+
interface ObjectConstructor {
36+
fromEntries?(xs: [string|number|symbol, any][]): object
37+
}
2238
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Copyright 2020 New Vector Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
import * as React from "react";
18+
import * as PropTypes from "prop-types";
19+
20+
import { _t } from "matrix-react-sdk/src/languageHandler";
21+
22+
interface IProps {
23+
title: string;
24+
messages?: string[];
25+
}
26+
27+
const ErrorView: React.FC<IProps> = ({title, messages}) => {
28+
return <div className="mx_GenericErrorPage">
29+
<div className="mx_GenericErrorPage_box">
30+
<h1>{title}</h1>
31+
<div>
32+
{messages && messages.map(msg => <p key={msg}>
33+
{ _t(msg) }
34+
</p>)}
35+
</div>
36+
</div>
37+
</div>;
38+
};
39+
40+
ErrorView.propTypes = {
41+
title: PropTypes.string.isRequired,
42+
messages: PropTypes.arrayOf(PropTypes.string.isRequired),
43+
};
44+
45+
export default ErrorView;
46+

‎src/i18n/strings/bg.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"Chat with Riot Bot": "Чати с Riot Bot",
1212
"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.": "Може да използвате настройките за собствен сървър за да влезете в друг Matrix сървър, чрез указване на адреса му. Това ви позволява да използвате Riot със съществуващ Matrix акаунт, принадлежащ към друг сървър.",
1313
"Sign In": "Вписване",
14-
"Create Account": "Създай акаунт",
14+
"Create Account": "Създай профил",
1515
"Need help?": "Нужда от помощ?",
1616
"Explore rooms": "Открий стаи",
1717
"Room Directory": "Директория със стаи",

‎src/i18n/strings/cs.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@
2121
"Your Riot is misconfigured": "Riot je špatně nakonfigurován",
2222
"Unexpected error preparing the app. See console for details.": "Neočekávaná chyba při přípravě aplikace. Podrobnosti najdete v konzoli.",
2323
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Neplatná konfigurace: je možné specifikovat pouze jednu volbu z default_server_config, default_server_name, nebo default_hs_url.",
24-
"Invalid configuration: no default server specified.": "Neplatná konfigurace: není zadán výchozí server."
24+
"Invalid configuration: no default server specified.": "Neplatná konfigurace: není zadán výchozí server.",
25+
"Open user settings": "Otevřít uživatelské nastavení",
26+
"Go to your browser to complete Sign In": "Přejděte do prohlížeče a dokončete přihlášení"
2527
}

0 commit comments

Comments
 (0)