log.silly(req.requestId,`Message ${unpackedPayload.id} filtered by language (${unpackedPayload.language})`);
log.silly(req.requestId,`Message ${unpackedPayload.id} filtered by language (${unpackedPayload.language})`);
done();
return;
}
// When the account is not logged in, it is not necessary to confirm the block or mute
if(!req.accountId){
transmit();
return;
}
pgPool.connect((err,client,done)=>{
if(err){
log.error(err);
return;
}
constqueries=[
client.query(`SELECT 1 FROM blocks WHERE (account_id = $1 AND target_account_id IN (${placeholders(targetAccountIds,2)})) OR (account_id = $2 AND target_account_id = $1) UNION SELECT 1 FROM mutes WHERE account_id = $1 AND target_account_id IN (${placeholders(targetAccountIds,2)})`,[req.accountId,unpackedPayload.account.id].concat(targetAccountIds)),
];
if(accountDomain){
queries.push(client.query('SELECT 1 FROM account_domain_blocks WHERE account_id = $1 AND domain = $2',[req.accountId,accountDomain]));
client.query(`SELECT 1 FROM blocks WHERE (account_id = $1 AND target_account_id IN (${placeholders(targetAccountIds,2)})) OR (account_id = $2 AND target_account_id = $1) UNION SELECT 1 FROM mutes WHERE account_id = $1 AND target_account_id IN (${placeholders(targetAccountIds,2)})`,[req.accountId,unpackedPayload.account.id].concat(targetAccountIds)),
done();
];
log.error(err);
if(accountDomain){
queries.push(client.query('SELECT 1 FROM account_domain_blocks WHERE account_id = $1 AND domain = $2',[req.accountId,accountDomain]));