add: blocked users page

This commit is contained in:
trisua 2025-05-09 22:36:16 -04:00
parent 6893aeedb5
commit 3706764437
18 changed files with 427 additions and 178 deletions

View file

@ -23,7 +23,7 @@ pub async fn stripe_webhook(
let req = match stripe::Webhook::construct_event(
&body,
&sig.to_str().unwrap(),
sig.to_str().unwrap(),
&data.0.stripe.as_ref().unwrap().webhook_signing_secret,
) {
Ok(e) => e,

View file

@ -216,15 +216,13 @@ pub async fn handle_socket(socket: WebSocket, db: DataManager, community_id: Str
if !cs {
continue;
}
} else {
if !headers.is_channel {
// since we didn't select by just a channel, there HAS to be
// an entry for the channel for us to check this message
continue;
// we don't need to check messages when we're subscribed to
// a channel, since that is checked on headers submission when
// we subscribe to a channel
}
} else if !headers.is_channel {
// since we didn't select by just a channel, there HAS to be
// an entry for the channel for us to check this message
continue;
// we don't need to check messages when we're subscribed to
// a channel, since that is checked on headers submission when
// we subscribe to a channel
}
if sink.send(WsMessage::Text(smsg.into())).await.is_err() {

View file

@ -67,7 +67,7 @@ pub async fn app_request(
Err(e) => return Err(Html(render_error(e, &jar, &data, &Some(user)).await)),
};
if let Some(ref channel) = channels.get(0) {
if let Some(channel) = channels.first() {
return Ok(Html(format!(
"<!doctype html><html><head><meta http-equiv=\"refresh\" content=\"0; url=/chats/{}/{}?nav={}\" /></head></html>",
selected_community, channel.id, props.nav

View file

@ -56,6 +56,15 @@ pub async fn settings_request(
}
};
let blocks = match data
.0
.fill_userblocks_receivers(data.0.get_userblocks_by_initiator(profile.id).await)
.await
{
Ok(r) => r,
Err(e) => return Err(Html(render_error(e, &jar, &data, &None).await)),
};
let tokens = profile.tokens.clone();
let lang = get_lang!(jar, data.0);
@ -63,6 +72,7 @@ pub async fn settings_request(
context.insert("profile", &profile);
context.insert("stacks", &stacks);
context.insert("blocks", &blocks);
context.insert("user_settings_serde", &clean_settings(&profile.settings));
context.insert(
"user_tokens_serde",