mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 17:26:30 +03:00
cargo fmt
Also formatted SQL query, because rustfmt can't format statements with too long strings.
This commit is contained in:
committed by
link2xt
parent
093839c2b0
commit
25274f13c3
42
src/chat.rs
42
src/chat.rs
@@ -974,8 +974,26 @@ impl Chat {
|
||||
|
||||
// add message to the database
|
||||
|
||||
if context.sql.execute(
|
||||
"INSERT INTO msgs (rfc724_mid, chat_id, from_id, to_id, timestamp, type, state, txt, param, hidden, mime_in_reply_to, mime_references, location_id, ephemeral_timer, ephemeral_timestamp) VALUES (?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?);",
|
||||
if context
|
||||
.sql
|
||||
.execute(
|
||||
"INSERT INTO msgs (
|
||||
rfc724_mid,
|
||||
chat_id,
|
||||
from_id,
|
||||
to_id,
|
||||
timestamp,
|
||||
type,
|
||||
state,
|
||||
txt,
|
||||
param,
|
||||
hidden,
|
||||
mime_in_reply_to,
|
||||
mime_references,
|
||||
location_id,
|
||||
ephemeral_timer,
|
||||
ephemeral_timestamp)
|
||||
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);",
|
||||
paramsv![
|
||||
new_rfc724_mid,
|
||||
self.id,
|
||||
@@ -992,19 +1010,19 @@ impl Chat {
|
||||
location_id as i32,
|
||||
ephemeral_timer,
|
||||
ephemeral_timestamp
|
||||
]
|
||||
).await.is_ok() {
|
||||
msg_id = context.sql.get_rowid(
|
||||
context,
|
||||
"msgs",
|
||||
"rfc724_mid",
|
||||
new_rfc724_mid,
|
||||
).await?;
|
||||
],
|
||||
)
|
||||
.await
|
||||
.is_ok()
|
||||
{
|
||||
msg_id = context
|
||||
.sql
|
||||
.get_rowid(context, "msgs", "rfc724_mid", new_rfc724_mid)
|
||||
.await?;
|
||||
} else {
|
||||
error!(
|
||||
context,
|
||||
"Cannot send message, cannot insert to database ({}).",
|
||||
self.id,
|
||||
"Cannot send message, cannot insert to database ({}).", self.id,
|
||||
);
|
||||
}
|
||||
schedule_ephemeral_task(context).await;
|
||||
|
||||
Reference in New Issue
Block a user