mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Remove redundant checks in prepare_msg_raw()
This commit is contained in:
29
src/chat.rs
29
src/chat.rs
@@ -379,21 +379,14 @@ impl<'a> Chat<'a> {
|
|||||||
let parent_in_reply_to = parent_in_reply_to.strdup();
|
let parent_in_reply_to = parent_in_reply_to.strdup();
|
||||||
let parent_references = parent_references.strdup();
|
let parent_references = parent_references.strdup();
|
||||||
|
|
||||||
if !parent_rfc724_mid.is_null()
|
if 0 != *parent_rfc724_mid.offset(0isize) as libc::c_int {
|
||||||
&& 0 != *parent_rfc724_mid.offset(0isize) as libc::c_int
|
|
||||||
{
|
|
||||||
new_in_reply_to = dc_strdup(parent_rfc724_mid)
|
new_in_reply_to = dc_strdup(parent_rfc724_mid)
|
||||||
}
|
}
|
||||||
if !parent_references.is_null() {
|
let space = strchr(parent_references, ' ' as i32);
|
||||||
let space: *mut libc::c_char;
|
if !space.is_null() {
|
||||||
space = strchr(parent_references, ' ' as i32);
|
*space = 0 as libc::c_char
|
||||||
if !space.is_null() {
|
|
||||||
*space = 0 as libc::c_char
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if !parent_references.is_null()
|
if 0 != *parent_references.offset(0isize) as libc::c_int
|
||||||
&& 0 != *parent_references.offset(0isize) as libc::c_int
|
|
||||||
&& !parent_rfc724_mid.is_null()
|
|
||||||
&& 0 != *parent_rfc724_mid.offset(0isize) as libc::c_int
|
&& 0 != *parent_rfc724_mid.offset(0isize) as libc::c_int
|
||||||
{
|
{
|
||||||
new_references = dc_mprintf(
|
new_references = dc_mprintf(
|
||||||
@@ -401,13 +394,9 @@ impl<'a> Chat<'a> {
|
|||||||
parent_references,
|
parent_references,
|
||||||
parent_rfc724_mid,
|
parent_rfc724_mid,
|
||||||
)
|
)
|
||||||
} else if !parent_references.is_null()
|
} else if 0 != *parent_references.offset(0isize) as libc::c_int {
|
||||||
&& 0 != *parent_references.offset(0isize) as libc::c_int
|
|
||||||
{
|
|
||||||
new_references = dc_strdup(parent_references)
|
new_references = dc_strdup(parent_references)
|
||||||
} else if !parent_in_reply_to.is_null()
|
} else if 0 != *parent_in_reply_to.offset(0isize) as libc::c_int
|
||||||
&& 0 != *parent_in_reply_to.offset(0isize) as libc::c_int
|
|
||||||
&& !parent_rfc724_mid.is_null()
|
|
||||||
&& 0 != *parent_rfc724_mid.offset(0isize) as libc::c_int
|
&& 0 != *parent_rfc724_mid.offset(0isize) as libc::c_int
|
||||||
{
|
{
|
||||||
new_references = dc_mprintf(
|
new_references = dc_mprintf(
|
||||||
@@ -415,9 +404,7 @@ impl<'a> Chat<'a> {
|
|||||||
parent_in_reply_to,
|
parent_in_reply_to,
|
||||||
parent_rfc724_mid,
|
parent_rfc724_mid,
|
||||||
)
|
)
|
||||||
} else if !parent_in_reply_to.is_null()
|
} else if 0 != *parent_in_reply_to.offset(0isize) as libc::c_int {
|
||||||
&& 0 != *parent_in_reply_to.offset(0isize) as libc::c_int
|
|
||||||
{
|
|
||||||
new_references = dc_strdup(parent_in_reply_to)
|
new_references = dc_strdup(parent_in_reply_to)
|
||||||
}
|
}
|
||||||
free(parent_rfc724_mid as *mut libc::c_void);
|
free(parent_rfc724_mid as *mut libc::c_void);
|
||||||
|
|||||||
Reference in New Issue
Block a user