fix(notifications/timeline): low lengths. chore(config): add invidious.fdn.fr.

This commit is contained in:
vulet 2021-04-25 15:53:23 +08:00
parent 340fed6346
commit 39a88b2722
3 changed files with 6 additions and 4 deletions

View file

@ -12,7 +12,8 @@ exports.runQuery = function (roomId) {
const len = events.length; const len = events.length;
for (let i = len - 1; i >= 0; i--) { for (let i = len - 1; i >= 0; i--) {
if (past.findIndex((x) => x.created_at === events[i].created_at) === -1) { if (past.findIndex((x) => x.created_at === events[i].created_at) === -1) {
if (events[i].created_at < past.slice(18, 19)[0].created_at) return; const lastStored = past.slice(past.length - 1, past.length);
if (events[i].created_at < lastStored[0].created_at) return;
events[i].label = 'status'; events[i].label = 'status';
fediverse.utils.formatter(events[i], roomId); fediverse.utils.formatter(events[i], roomId);
} }

View file

@ -12,7 +12,8 @@ exports.runQuery = function (roomId) {
const len = events.length; const len = events.length;
for (let i = len - 1; i >= 0; i--) { for (let i = len - 1; i >= 0; i--) {
if (past.findIndex((x) => x.created_at === events[i].created_at) === -1) { if (past.findIndex((x) => x.created_at === events[i].created_at) === -1) {
if (events[i].created_at < past.slice(18, 19)[0].created_at) return; const lastStored = past.slice(past.length - 1, past.length);
if (events[i].created_at < lastStored[0].created_at) return;
events[i].label = 'notifications'; events[i].label = 'notifications';
fediverse.utils.formatter(events[i], roomId); fediverse.utils.formatter(events[i], roomId);
} }

View file

@ -25,12 +25,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', 'mobile.twitter.com', 'm.twitter.com' ], domains: [ 'nitter.net', 'www.nitter.net', 'twitter.com', 'www.twitter.com', 'mobile.twitter.com', 'm.twitter.com', 'nitter.fdn.fr' ],
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', 'm.youtube.com' ] domains: [ 'invidious.snopyta.org', 'invidious.xyz', 'youtube.com', 'www.youtube.com', 'youtu.be', 'm.youtube.com', 'invidious.fdn.fr' ]
} }
}; };