diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-11-17 21:16:52 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-11-18 02:19:05 -0600 |
commit | b1049bc149d5a9891d50a6e7546f91c278a5b086 (patch) | |
tree | 8241da9612d7c5e55bf0b745ff3b9fbdedfd9bfb | |
parent | 68fa5ca1b7c2ea8cb4bb1bcfa17210457f3df6b6 (diff) |
When streaming posts to timelines, do not apply filters to the author's own posts.
-rw-r--r-- | streaming/index.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/streaming/index.js b/streaming/index.js index 01bd6ea95..cde3069ba 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -328,6 +328,11 @@ const startWorker = (workerId) => { output(event, encodedPayload); }; + if (!req.accountId) { + log.error(req.requestId, `Unauthorized: ${accountId} is not logged in.`) + return; + } + if (notificationOnly && event !== 'notification') { return; } @@ -354,14 +359,14 @@ const startWorker = (workerId) => { const targetAccountIds = [unpackedPayload.account.id].concat(unpackedPayload.mentions.map(item => item.id)); const accountDomain = unpackedPayload.account.acct.split('@')[1]; - if (Array.isArray(req.chosenLanguages) && unpackedPayload.language !== null && req.chosenLanguages.indexOf(unpackedPayload.language) === -1) { - log.silly(req.requestId, `Message ${unpackedPayload.id} filtered by language (${unpackedPayload.language})`); - return; + // Don't filter user's own events. + if (req.accountId === unpackedPayload.account.id) { + transmit(); + return } - // When the account is not logged in, it is not necessary to confirm the block or mute - if (!req.accountId) { - transmit(); + if (Array.isArray(req.chosenLanguages) && unpackedPayload.language !== null && req.chosenLanguages.indexOf(unpackedPayload.language) === -1) { + log.silly(req.requestId, `Message ${unpackedPayload.id} filtered by language (${unpackedPayload.language})`); return; } |