generated from t/malachite
add: full working chats
This commit is contained in:
parent
b360c5e737
commit
3f8171938e
7 changed files with 77 additions and 13 deletions
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue