mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 23:36:30 +03:00
Change return type of clist_search_string_nocase to `bool'
This commit is contained in:
@@ -148,7 +148,7 @@ pub unsafe fn dc_mimefactory_load_msg(
|
|||||||
for row in rows {
|
for row in rows {
|
||||||
let (authname, addr) = row?;
|
let (authname, addr) = row?;
|
||||||
let addr_c = addr.strdup();
|
let addr_c = addr.strdup();
|
||||||
if clist_search_string_nocase(factory.recipients_addr, addr_c) == 0 {
|
if !clist_search_string_nocase(factory.recipients_addr, addr_c) {
|
||||||
clist_insert_after(
|
clist_insert_after(
|
||||||
factory.recipients_names,
|
factory.recipients_names,
|
||||||
(*factory.recipients_names).last,
|
(*factory.recipients_names).last,
|
||||||
@@ -183,7 +183,7 @@ pub unsafe fn dc_mimefactory_load_msg(
|
|||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
if !email_to_remove.is_empty() && email_to_remove != self_addr {
|
if !email_to_remove.is_empty() && email_to_remove != self_addr {
|
||||||
if clist_search_string_nocase(factory.recipients_addr, email_to_remove_c) == 0 {
|
if !clist_search_string_nocase(factory.recipients_addr, email_to_remove_c) {
|
||||||
clist_insert_after(
|
clist_insert_after(
|
||||||
factory.recipients_names,
|
factory.recipients_names,
|
||||||
(*factory.recipients_names).last,
|
(*factory.recipients_names).last,
|
||||||
|
|||||||
@@ -435,13 +435,10 @@ pub unsafe fn clist_free_content(haystack: *const clist) {
|
|||||||
pub unsafe fn clist_search_string_nocase(
|
pub unsafe fn clist_search_string_nocase(
|
||||||
haystack: *const clist,
|
haystack: *const clist,
|
||||||
needle: *const libc::c_char,
|
needle: *const libc::c_char,
|
||||||
) -> libc::c_int {
|
) -> bool {
|
||||||
for data in &*haystack {
|
(&*haystack)
|
||||||
if strcasecmp(data.cast(), needle) == 0 {
|
.into_iter()
|
||||||
return 1;
|
.any(|data| strcasecmp(data.cast(), needle) == 0)
|
||||||
}
|
|
||||||
}
|
|
||||||
0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* date/time tools */
|
/* date/time tools */
|
||||||
|
|||||||
@@ -692,9 +692,7 @@ pub unsafe fn job_send_msg(context: &Context, msg_id: uint32_t) -> libc::c_int {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
/* unrecoverable */
|
/* unrecoverable */
|
||||||
if clist_search_string_nocase(mimefactory.recipients_addr, mimefactory.from_addr)
|
if !clist_search_string_nocase(mimefactory.recipients_addr, mimefactory.from_addr) {
|
||||||
== 0i32
|
|
||||||
{
|
|
||||||
clist_insert_after(
|
clist_insert_after(
|
||||||
mimefactory.recipients_names,
|
mimefactory.recipients_names,
|
||||||
(*mimefactory.recipients_names).last,
|
(*mimefactory.recipients_names).last,
|
||||||
|
|||||||
Reference in New Issue
Block a user