From 98f2d865b9c7c50d3b7ddbd9fa28a1d4e8f413b8 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 May 2019 20:03:42 -0600 Subject: [PATCH 1/2] Add 'showLabsSettings' flag to docs+sample config --- README.md | 2 ++ config.sample.json | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 5e46e757d08..cc3ab2c2cfc 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,8 @@ For a good example, see https://riot.im/develop/config.json. in the `labs` section of settings. The available optional experimental features vary from release to release. Some of the available features are described in the Labs Feature section of this README. +1. `showLabsSettings`: Shows the "labs" tab of user settings even when no `features` are enabled + or present. Useful for getting at settings which may be otherwise hidden. 1. `brand`: String to pass to your homeserver when configuring email notifications, to let the homeserver know what email template to use when talking to you. 1. `branding`: Configures various branding and logo details, such as: diff --git a/config.sample.json b/config.sample.json index beb9c9f0abe..db1d25d1d25 100644 --- a/config.sample.json +++ b/config.sample.json @@ -18,6 +18,7 @@ "integrations_rest_url": "https://scalar.vector.im/api", "integrations_jitsi_widget_url": "https://scalar.vector.im/api/widgets/jitsi.html", "bug_report_endpoint_url": "https://riot.im/bugreports/submit", + "showLabsSettings": false, "features": { "feature_groups": "labs", "feature_pinning": "labs", From c5461b4509bf7c309be75f7b7d9cc8aa602f4402 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 30 May 2019 20:04:16 -0600 Subject: [PATCH 2/2] Don't try and render null avatars in desktop notifications as much fun as http://localhost:8080/null is to see --- src/vector/platform/ElectronPlatform.js | 14 ++++++-------- src/vector/platform/WebPlatform.js | 16 +++++++--------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index fcab36ac399..04f472d6455 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -141,14 +141,12 @@ export default class ElectronPlatform extends VectorBasePlatform { } // Notifications in Electron use the HTML5 notification API - const notification = new global.Notification( - title, - { - body: msg, - icon: avatarUrl, - silent: true, // we play our own sounds - }, - ); + const notifBody = { + body: msg, + silent: true, // we play our own sounds + }; + if (avatarUrl) notifBody['icon'] = avatarUrl; + const notification = new global.Notification(title, notifBody); notification.onclick = () => { dis.dispatch({ diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index d850dd6ddd5..984aa8da3ad 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -76,15 +76,13 @@ export default class WebPlatform extends VectorBasePlatform { } displayNotification(title: string, msg: string, avatarUrl: string, room: Object) { - const notification = new global.Notification( - title, - { - body: msg, - icon: avatarUrl, - tag: "vector", - silent: true, // we play our own sounds - }, - ); + const notifBody = { + body: msg, + tag: "vector", + silent: true, // we play our own sounds + }; + if (avatarUrl) notifBody['icon'] = avatarUrl; + const notification = new global.Notification(title, notifBody); notification.onclick = function() { dis.dispatch({