if (Array.isArray(req.filteredLanguages)&&req.filteredLanguages.indexOf(unpackedPayload.language)!==-1){
log.silly(req.requestId,`Message ${unpackedPayload.id} filtered by language (${unpackedPayload.language})`);
done();
if (Array.isArray(req.filteredLanguages)&&req.filteredLanguages.indexOf(unpackedPayload.language)!==-1){
log.silly(req.requestId,`Message ${unpackedPayload.id} filtered by language (${unpackedPayload.language})`);
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]));
}
Promise.all(queries).then(values=>{
done();
if (values[0].rows.length>0||(values.length>1&&values[1].rows.length>0)){
return;
}
if (req.accountId){
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]));
}
Promise.all(queries).then(values=>{
done();
if (values[0].rows.length>0||(values.length>1&&values[1].rows.length>0)){