mirror of
https://github.com/chatmail/core.git
synced 2026-05-25 09:46:31 +03:00
cargo fmt
This commit is contained in:
committed by
Floris Bruynooghe
parent
612600278a
commit
ee18d60644
@@ -1690,10 +1690,13 @@ fn set_group_explicitly_left(context: &Context, grpid: impl AsRef<str>) -> Resul
|
||||
}
|
||||
|
||||
pub fn is_group_explicitly_left(context: &Context, grpid: impl AsRef<str>) -> Result<bool, Error> {
|
||||
context.sql.exists(
|
||||
context
|
||||
.sql
|
||||
.exists(
|
||||
"SELECT id FROM leftgrps WHERE grpid=?;",
|
||||
params![grpid.as_ref()],
|
||||
).map_err(Into::into)
|
||||
)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn set_chat_name(
|
||||
|
||||
@@ -495,7 +495,9 @@ pub fn save(
|
||||
independent: bool,
|
||||
) -> Result<u32, Error> {
|
||||
ensure!(chat_id > DC_CHAT_ID_LAST_SPECIAL, "Invalid chat id");
|
||||
context.sql.prepare2(
|
||||
context
|
||||
.sql
|
||||
.prepare2(
|
||||
"SELECT id FROM locations WHERE timestamp=? AND from_id=?",
|
||||
"INSERT INTO locations\
|
||||
(timestamp, from_id, chat_id, latitude, longitude, accuracy, independent) \
|
||||
@@ -505,7 +507,8 @@ pub fn save(
|
||||
let mut newest_location_id = 0;
|
||||
|
||||
for location in locations {
|
||||
let exists = stmt_test.exists(params![location.timestamp, contact_id as i32])?;
|
||||
let exists =
|
||||
stmt_test.exists(params![location.timestamp, contact_id as i32])?;
|
||||
|
||||
if independent || !exists {
|
||||
stmt_insert.execute(params![
|
||||
@@ -534,7 +537,8 @@ pub fn save(
|
||||
}
|
||||
Ok(newest_location_id)
|
||||
},
|
||||
).map_err(Into::into)
|
||||
)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
||||
@@ -191,7 +191,9 @@ impl Message {
|
||||
!id.is_special(),
|
||||
"Can not load special message IDs from DB."
|
||||
);
|
||||
context.sql.query_row(
|
||||
context
|
||||
.sql
|
||||
.query_row(
|
||||
concat!(
|
||||
"SELECT",
|
||||
" m.id AS id,",
|
||||
@@ -266,7 +268,8 @@ impl Message {
|
||||
|
||||
Ok(msg)
|
||||
},
|
||||
).map_err(Into::into)
|
||||
)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn delete_from_db(context: &Context, msg_id: MsgId) {
|
||||
@@ -1246,7 +1249,9 @@ pub(crate) fn rfc724_mid_exists(
|
||||
) -> Result<(String, u32, MsgId), Error> {
|
||||
ensure!(!rfc724_mid.is_empty(), "empty rfc724_mid");
|
||||
|
||||
context.sql.query_row(
|
||||
context
|
||||
.sql
|
||||
.query_row(
|
||||
"SELECT server_folder, server_uid, id FROM msgs WHERE rfc724_mid=?",
|
||||
&[rfc724_mid],
|
||||
|row| {
|
||||
@@ -1256,7 +1261,8 @@ pub(crate) fn rfc724_mid_exists(
|
||||
|
||||
Ok((server_folder, server_uid, msg_id))
|
||||
},
|
||||
).map_err(Into::into)
|
||||
)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn update_server_uid(
|
||||
|
||||
Reference in New Issue
Block a user