add: block list stacks

This commit is contained in:
trisua 2025-06-15 11:52:44 -04:00
parent 9bb5f38f76
commit b71ae1f5a4
28 changed files with 700 additions and 219 deletions

View file

@ -203,11 +203,16 @@ macro_rules! check_user_blocked_or_private {
// check if we're blocked
if let Some(ref ua) = $user {
if $data
if ($data
.0
.get_userblock_by_initiator_receiver($other_user.id, ua.id)
.await
.is_ok()
| $data
.0
.get_user_stack_blocked_users($other_user.id)
.await
.contains(&ua.id))
&& !ua.permissions.check(FinePermission::MANAGE_USERS)
{
let lang = get_lang!($jar, $data.0);
@ -291,10 +296,14 @@ macro_rules! check_user_blocked_or_private {
($user:expr, $other_user:ident, $data:ident, @api) => {
// check if we're blocked
if let Some(ref ua) = $user {
if $data
if ($data
.get_userblock_by_initiator_receiver($other_user.id, ua.id)
.await
.is_ok()
| $data
.get_user_stack_blocked_users($other_user.id)
.await
.contains(&ua.id))
&& !ua
.permissions
.check(tetratto_core::model::permissions::FinePermission::MANAGE_USERS)
@ -338,6 +347,7 @@ macro_rules! ignore_users_gen {
[
$data.0.get_userblocks_receivers(ua.id).await,
$data.0.get_userblocks_initiator_by_receivers(ua.id).await,
$data.0.get_user_stack_blocked_users(ua.id).await,
]
.concat()
} else {
@ -345,16 +355,17 @@ macro_rules! ignore_users_gen {
}
};
($user:ident!, $data:ident) => {
($user:ident!, $data:ident) => {{
[
$data.0.get_userblocks_receivers($user.id).await,
$data
.0
.get_userblocks_initiator_by_receivers($user.id)
.await,
$data.0.get_user_stack_blocked_users($user.id).await,
]
.concat()
};
}};
($user:ident!, #$data:ident) => {
[