mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
Do not format! SQL queries
This commit is contained in:
14
src/chat.rs
14
src/chat.rs
@@ -646,8 +646,8 @@ pub fn create_or_lookup_by_contact_id(
|
|||||||
sql::execute(
|
sql::execute(
|
||||||
context,
|
context,
|
||||||
&context.sql,
|
&context.sql,
|
||||||
format!(
|
"INSERT INTO chats (type, name, param, blocked, grpid, created_timestamp) VALUES(?, ?, ?, ?, ?, ?)",
|
||||||
"INSERT INTO chats (type, name, param, blocked, grpid, created_timestamp) VALUES({}, '{}', '{}', {}, '{}', {})",
|
params![
|
||||||
100,
|
100,
|
||||||
chat_name,
|
chat_name,
|
||||||
match contact_id {
|
match contact_id {
|
||||||
@@ -658,8 +658,7 @@ pub fn create_or_lookup_by_contact_id(
|
|||||||
create_blocked as u8,
|
create_blocked as u8,
|
||||||
contact.get_addr(),
|
contact.get_addr(),
|
||||||
time(),
|
time(),
|
||||||
),
|
]
|
||||||
params![],
|
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let chat_id = sql::get_rowid(context, &context.sql, "chats", "grpid", contact.get_addr());
|
let chat_id = sql::get_rowid(context, &context.sql, "chats", "grpid", contact.get_addr());
|
||||||
@@ -667,11 +666,8 @@ pub fn create_or_lookup_by_contact_id(
|
|||||||
sql::execute(
|
sql::execute(
|
||||||
context,
|
context,
|
||||||
&context.sql,
|
&context.sql,
|
||||||
format!(
|
"INSERT INTO chats_contacts (chat_id, contact_id) VALUES(?, ?)",
|
||||||
"INSERT INTO chats_contacts (chat_id, contact_id) VALUES({}, {})",
|
params![chat_id, contact_id],
|
||||||
chat_id, contact_id
|
|
||||||
),
|
|
||||||
params![],
|
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if contact_id == DC_CONTACT_ID_SELF {
|
if contact_id == DC_CONTACT_ID_SELF {
|
||||||
|
|||||||
Reference in New Issue
Block a user