add: hide posts from users who have blocked you from timelines

This commit is contained in:
trisua 2025-05-29 18:59:53 -04:00
parent 22ae479bd7
commit 8de5c0ea76
10 changed files with 84 additions and 81 deletions

View file

@ -224,3 +224,29 @@ macro_rules! check_user_blocked_or_private {
}
};
}
#[macro_export]
macro_rules! ignore_users_gen {
($user:ident, $data:ident) => {
if let Some(ref ua) = $user {
[
$data.0.get_userblocks_receivers(ua.id).await,
$data.0.get_userblocks_initiator_by_receivers(ua.id).await,
]
.concat()
} else {
Vec::new()
}
};
($user:ident!, $data:ident) => {
[
$data.0.get_userblocks_receivers($user.id).await,
$data
.0
.get_userblocks_initiator_by_receivers($user.id)
.await,
]
.concat()
};
}