diff --git a/.ruby-version b/.ruby-version index 37c2961c2430f357166156e7ddf1c590eb8d4ce1..338a5b5d8fec491b97978114dc35e36348fa56a7 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.2 +2.6.6 diff --git a/streaming/index.js b/streaming/index.js index a4a1df9def4bccef9bc75fa99edfa766bceff48d..eb44d6a348e89f7e378cc377c9bb6319459fe2e4 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -294,9 +294,10 @@ const startWorker = (workerId) => { return; } - client.query('SELECT oauth_access_tokens.resource_owner_id, users.account_id, users.chosen_languages, oauth_access_tokens.scopes, devices.device_id, oauth_applications.name, oauth_applications.website FROM oauth_access_tokens INNER JOIN oauth_applications ON oauth_access_tokens.application_id = oauth_applications.id INNER JOIN users ON oauth_access_tokens.resource_owner_id = users.id LEFT OUTER JOIN devices ON oauth_access_tokens.id = devices.access_token_id WHERE oauth_access_tokens.token = $1 AND oauth_access_tokens.revoked_at IS NULL LIMIT 1', [token], (err, result) => { + client.query('SELECT oauth_access_tokens.resource_owner_id, users.account_id, users.chosen_languages, oauth_access_tokens.scopes, devices.device_id FROM oauth_access_tokens INNER JOIN users ON oauth_access_tokens.resource_owner_id = users.id LEFT OUTER JOIN devices ON oauth_access_tokens.id = devices.access_token_id WHERE oauth_access_tokens.token = $1 AND oauth_access_tokens.revoked_at IS NULL LIMIT 1', [token], (err, result) => { done(); + if (err) { reject(err); return; @@ -315,8 +316,6 @@ const startWorker = (workerId) => { req.chosenLanguages = result.rows[0].chosen_languages; req.allowNotifications = req.scopes.some(scope => ['read', 'read:notifications'].includes(scope)); req.deviceId = result.rows[0].device_id; - req.applicationName = result.rows[0].name; - req.website = result.rows[0].website; resolve(); }); @@ -759,7 +758,7 @@ const startWorker = (workerId) => { break; case 'public': resolve({ - channelIds: req.applicationName === 'â—† Tootdon â—†' ? ['timeline:public:remote'] : ['timeline:public'], + channelIds: ['timeline:public'], options: { needsFiltering: true, notificationOnly: false }, }); @@ -802,16 +801,12 @@ const startWorker = (workerId) => { break; case 'public:media': resolve({ - channelIds: req.applicationName === 'â—† Tootdon â—†' ? ['timeline:public:remote:media'] : ['timeline:public:media'], + channelIds: ['timeline:public:media'], options: { needsFiltering: true, notificationOnly: false }, }); break; case 'public:local:media': - if (!isImast(req)) { - reject('No local media stream provided'); - } - resolve({ channelIds: ['timeline:public:media'], options: { needsFiltering: true, notificationOnly: false }, @@ -1065,14 +1060,6 @@ const startWorker = (workerId) => { process.on('uncaughtException', onError); }; -/** - * @param {any} req - * @return {boolean} - */ -const isImast = (req) => { - return req.website == 'https://cinderella-project.github.io/iMast/'; -}; - /** * @param {any} server * @param {function(string): void} [onSuccess]