From fcadc5addc1dc63dcb5176a0b635f4e366c0479c Mon Sep 17 00:00:00 2001 From: vulet Date: Sun, 21 Feb 2021 19:07:56 +0800 Subject: [PATCH] refactor(e2ee): session management in config --- config.example.js | 7 ++++--- main.js | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config.example.js b/config.example.js index 2f909fd..fac0ba1 100644 --- a/config.example.js +++ b/config.example.js @@ -3,7 +3,8 @@ module.exports = { domain: 'https://your_homeserver.com', user: '@your_user:your_homeserver.com', password: 'your_password', - domains: [ 'your_homeserver.com' ] + domains: [ 'your_homeserver.com' ], + manualVerify: false, }, fediverse: { domain: 'https://your_federation.com', @@ -23,12 +24,12 @@ module.exports = { nitter: { domain: 'nitter.fdn.fr', userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', - domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com' ], + domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com', 'mobile.twitter.com', 'm.twitter.com' ], check: '(✅)' }, invidious: { domain: 'invidious.fdn.fr', userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', - domains: [ 'invidious.snopyta.org', 'invidious.xyz', 'youtube.com', 'www.youtube.com', 'youtu.be' ] + domains: [ 'invidious.snopyta.org', 'invidious.xyz', 'youtube.com', 'www.youtube.com', 'youtu.be', 'm.youtube.com' ] } }; diff --git a/main.js b/main.js index e96f1f5..15c0d1e 100644 --- a/main.js +++ b/main.js @@ -26,6 +26,7 @@ matrixClient.on('event', async (event) => { }); matrixClient.on('Room.timeline', async (event, member, toStartOfTimeline) => { + matrixClient.setGlobalErrorOnUnknownDevices(config.matrix.manualVerify); if (toStartOfTimeline) return; if (event.isEncrypted()) await event._decryptionPromise; if (event.getType() !== 'm.room.message') return;