Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 1006d50

Browse files
committed
Merge remote-tracking branch 'origin/develop' into release-v0.8.1
2 parents 66f72e6 + 587325b commit 1006d50

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

src/BasePlatform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default class BasePlatform {
6363
requestNotificationPermission() : Promise<string> {
6464
}
6565

66-
displayNotification(title: string, msg: string, avatarUrl: string) {
66+
displayNotification(title: string, msg: string, avatarUrl: string, room: Object) {
6767
}
6868

6969
/**

src/Notifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var Notifier = {
7373
ev.sender, 40, 40, 'crop'
7474
) : null;
7575

76-
const notif = plaf.displayNotification(title, msg, avatarUrl);
76+
const notif = plaf.displayNotification(title, msg, avatarUrl, room);
7777

7878
// if displayNotification returns non-null, the platform supports
7979
// clearing notifications later, so keep track of this.

src/ScalarMessaging.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,15 @@ const onMessage = function(event) {
292292
event.origin = event.originalEvent.origin;
293293
}
294294

295-
// check it is from the integrations UI URL (remove trailing spaces)
295+
// Check that the integrations UI URL starts with the origin of the event
296+
// This means the URL could contain a path (like /develop) and still be used
297+
// to validate event origins, which do not specify paths.
298+
// (See https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
299+
//
300+
// All strings start with the empty string, so for sanity return if the length
301+
// of the event origin is 0.
296302
let url = SdkConfig.get().integrations_ui_url;
297-
if (url.endsWith("/")) {
298-
url = url.substr(0, url.length - 1);
299-
}
300-
if (url !== event.origin) {
303+
if (event.origin.length === 0 || !url.startsWith(event.origin)) {
301304
return; // don't log this - debugging APIs like to spam postMessage which floods the log otherwise
302305
}
303306

src/components/structures/ScrollPanel.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,9 @@ module.exports = React.createClass({
402402
q.finally(fillPromise, () => {
403403
this._pendingFillRequests[dir] = false;
404404
}).then((hasMoreResults) => {
405+
if (this.unmounted) {
406+
return;
407+
}
405408
// Unpaginate once filling is complete
406409
this._checkUnfillState(!backwards);
407410

src/components/structures/UserSettings.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,15 @@ module.exports = React.createClass({
338338
},
339339

340340
_renderCryptoInfo: function() {
341-
var client = MatrixClientPeg.get();
342-
var deviceId = client.deviceId;
343-
var identityKey = client.getDeviceEd25519Key() || "<not supported>";
341+
const client = MatrixClientPeg.get();
342+
const deviceId = client.deviceId;
343+
const identityKey = client.getDeviceEd25519Key() || "<not supported>";
344344

345-
var myDevice = client.getStoredDevicesForUser(MatrixClientPeg.get().credentials.userId)[0];
346345
return (
347346
<div>
348347
<h3>Cryptography</h3>
349348
<div className="mx_UserSettings_section mx_UserSettings_cryptoSection">
350349
<ul>
351-
<li><label>Device name:</label> <span>{ myDevice.getDisplayName() }</span></li>
352350
<li><label>Device ID:</label> <span><code>{deviceId}</code></span></li>
353351
<li><label>Device key:</label> <span><code><b>{identityKey}</b></code></span></li>
354352
</ul>

src/components/views/elements/DirectorySearchBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default class DirectorySearchBox extends React.Component {
8989

9090
return <span className={classnames(searchbox_classes)}>
9191
<div className="mx_DirectorySearchBox_container">
92-
<input type="text" value={this.state.value}
92+
<input type="text" name="dirsearch" value={this.state.value}
9393
className="mx_DirectorySearchBox_input"
9494
ref={this._collectInput}
9595
onChange={this._onChange} onKeyUp={this._onKeyUp}

0 commit comments

Comments
 (0)