add: full working chats

This commit is contained in:
trisua 2025-08-28 20:26:38 -04:00
parent b360c5e737
commit 3f8171938e
7 changed files with 77 additions and 13 deletions

View file

@ -71,7 +71,7 @@ pub async fn chat_request(
}
};
let messages = match data.get_messages_by_chat(id, 12, props.page).await {
let messages = match data.get_messages_by_chat(id, 24, props.page).await {
Ok(x) => x,
Err(e) => {
return Err(render_error(e, tera, data.0.0.clone(), Some(user)).await);
@ -132,9 +132,9 @@ pub async fn messages_request(
};
let messages = match if before > 0 {
data.get_messages_by_chat_before(id, before, 12, 0).await
data.get_messages_by_chat_before(id, before, 24, 0).await
} else {
data.get_messages_by_chat(id, 12, 0).await
data.get_messages_by_chat(id, 24, 0).await
} {
Ok(x) => x,
Err(e) => {
@ -145,8 +145,8 @@ pub async fn messages_request(
let mut ctx = default_context(&data.0.0, &build_code, &Some(user));
ctx.insert(
"first_message_time",
&match messages.first() {
"last_message_time",
&match messages.last() {
Some(x) => x.created,
None => 0,
},