mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
run rustfmt
This commit is contained in:
15
src/dc_qr.rs
15
src/dc_qr.rs
@@ -223,16 +223,14 @@ pub unsafe fn dc_check_qr(context: &Context, qr: *const libc::c_char) -> *mut dc
|
|||||||
if strlen(fingerprint) != 40 {
|
if strlen(fingerprint) != 40 {
|
||||||
(*qr_parsed).state = 400i32;
|
(*qr_parsed).state = 400i32;
|
||||||
(*qr_parsed).text1 = dc_strdup(
|
(*qr_parsed).text1 = dc_strdup(
|
||||||
b"Bad fingerprint length in QR code.\x00" as *const u8
|
b"Bad fingerprint length in QR code.\x00" as *const u8 as *const libc::c_char,
|
||||||
as *const libc::c_char,
|
|
||||||
);
|
);
|
||||||
return cleanup();
|
return cleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !fingerprint.is_null() {
|
if !fingerprint.is_null() {
|
||||||
let peerstate =
|
let peerstate = Peerstate::from_fingerprint(context, &context.sql, as_str(fingerprint));
|
||||||
Peerstate::from_fingerprint(context, &context.sql, as_str(fingerprint));
|
|
||||||
if addr.is_null() || invitenumber.is_null() || auth.is_null() {
|
if addr.is_null() || invitenumber.is_null() || auth.is_null() {
|
||||||
if let Some(peerstate) = peerstate {
|
if let Some(peerstate) = peerstate {
|
||||||
(*qr_parsed).state = 210i32;
|
(*qr_parsed).state = 210i32;
|
||||||
@@ -272,13 +270,8 @@ pub unsafe fn dc_check_qr(context: &Context, qr: *const libc::c_char) -> *mut dc
|
|||||||
} else {
|
} else {
|
||||||
(*qr_parsed).state = 200i32
|
(*qr_parsed).state = 200i32
|
||||||
}
|
}
|
||||||
(*qr_parsed).id = dc_add_or_lookup_contact(
|
(*qr_parsed).id =
|
||||||
context,
|
dc_add_or_lookup_contact(context, name, addr, 0x80i32, 0 as *mut libc::c_int);
|
||||||
name,
|
|
||||||
addr,
|
|
||||||
0x80i32,
|
|
||||||
0 as *mut libc::c_int,
|
|
||||||
);
|
|
||||||
(*qr_parsed).fingerprint = dc_strdup(fingerprint);
|
(*qr_parsed).fingerprint = dc_strdup(fingerprint);
|
||||||
(*qr_parsed).invitenumber = dc_strdup(invitenumber);
|
(*qr_parsed).invitenumber = dc_strdup(invitenumber);
|
||||||
(*qr_parsed).auth = dc_strdup(auth)
|
(*qr_parsed).auth = dc_strdup(auth)
|
||||||
|
|||||||
Reference in New Issue
Block a user