Commit 0f728d89 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Merge branch 'qoto-fedibird' into qoto

parents f1dab821 395f6abb
......@@ -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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment