add: show if user account is banned on profile

fix: check post owner privacy settings on community pages
This commit is contained in:
trisua 2025-05-16 00:25:44 -04:00
parent 03b252937b
commit 4c26879d00
9 changed files with 112 additions and 14 deletions

View file

@ -98,6 +98,17 @@ macro_rules! get_lang {
#[macro_export]
macro_rules! check_user_blocked_or_private {
($user:ident, $other_user:ident, $data:ident, $jar:ident) => {
// check if other user is banned
if $other_user.permissions.check_banned() {
let lang = get_lang!($jar, $data.0);
let mut context = initial_context(&$data.0.0, lang, &$user).await;
context.insert("profile", &$other_user);
return Ok(Html(
$data.1.render("profile/banned.html", &context).unwrap(),
));
}
// check if we're blocked
if let Some(ref ua) = $user {
if $data