cargo fmt

Also formatted SQL query, because rustfmt can't format statements with
too long strings.
This commit is contained in:
Alexander Krotov
2020-10-09 08:18:18 +03:00
committed by link2xt
parent 093839c2b0
commit 25274f13c3

View File

@@ -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;