add: show if user account is banned on profile
fix: check post owner privacy settings on community pages
This commit is contained in:
parent
03b252937b
commit
4c26879d00
9 changed files with 112 additions and 14 deletions
|
@ -42,6 +42,13 @@ fn check_supporter(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Va
|
|||
.into())
|
||||
}
|
||||
|
||||
fn check_staff_badge(value: &Value, _: &HashMap<String, Value>) -> tera::Result<Value> {
|
||||
Ok(FinePermission::from_bits(value.as_u64().unwrap() as u32)
|
||||
.unwrap()
|
||||
.check(FinePermission::STAFF_BADGE)
|
||||
.into())
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "multi_thread")]
|
||||
async fn main() {
|
||||
tracing_subscriber::fmt()
|
||||
|
@ -70,6 +77,7 @@ async fn main() {
|
|||
tera.register_filter("markdown", render_markdown);
|
||||
tera.register_filter("color", color_escape);
|
||||
tera.register_filter("has_supporter", check_supporter);
|
||||
tera.register_filter("has_staff_badge", check_staff_badge);
|
||||
|
||||
let client = Client::new();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue