refactor(e2ee): session management in config

This commit is contained in:
vulet 2021-02-21 19:07:56 +08:00
parent 9da2d13dbf
commit fcadc5addc
2 changed files with 5 additions and 3 deletions

View file

@ -3,7 +3,8 @@ module.exports = {
domain: 'https://your_homeserver.com', domain: 'https://your_homeserver.com',
user: '@your_user:your_homeserver.com', user: '@your_user:your_homeserver.com',
password: 'your_password', password: 'your_password',
domains: [ 'your_homeserver.com' ] domains: [ 'your_homeserver.com' ],
manualVerify: false,
}, },
fediverse: { fediverse: {
domain: 'https://your_federation.com', domain: 'https://your_federation.com',
@ -23,12 +24,12 @@ module.exports = {
nitter: { nitter: {
domain: 'nitter.fdn.fr', domain: 'nitter.fdn.fr',
userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', 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: '(✅)' check: '(✅)'
}, },
invidious: { invidious: {
domain: 'invidious.fdn.fr', domain: 'invidious.fdn.fr',
userAgent: 'Mozilla/4.0 (compatible; Beep Boop)', 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' ]
} }
}; };

View file

@ -26,6 +26,7 @@ matrixClient.on('event', async (event) => {
}); });
matrixClient.on('Room.timeline', async (event, member, toStartOfTimeline) => { matrixClient.on('Room.timeline', async (event, member, toStartOfTimeline) => {
matrixClient.setGlobalErrorOnUnknownDevices(config.matrix.manualVerify);
if (toStartOfTimeline) return; if (toStartOfTimeline) return;
if (event.isEncrypted()) await event._decryptionPromise; if (event.isEncrypted()) await event._decryptionPromise;
if (event.getType() !== 'm.room.message') return; if (event.getType() !== 'm.room.message') return;