mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +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 {
|
||||
let (authname, addr) = row?;
|
||||
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(
|
||||
factory.recipients_names,
|
||||
(*factory.recipients_names).last,
|
||||
@@ -183,7 +183,7 @@ pub unsafe fn dc_mimefactory_load_msg(
|
||||
.unwrap_or_default();
|
||||
|
||||
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(
|
||||
factory.recipients_names,
|
||||
(*factory.recipients_names).last,
|
||||
|
||||
@@ -435,13 +435,10 @@ pub unsafe fn clist_free_content(haystack: *const clist) {
|
||||
pub unsafe fn clist_search_string_nocase(
|
||||
haystack: *const clist,
|
||||
needle: *const libc::c_char,
|
||||
) -> libc::c_int {
|
||||
for data in &*haystack {
|
||||
if strcasecmp(data.cast(), needle) == 0 {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
0
|
||||
) -> bool {
|
||||
(&*haystack)
|
||||
.into_iter()
|
||||
.any(|data| strcasecmp(data.cast(), needle) == 0)
|
||||
}
|
||||
|
||||
/* date/time tools */
|
||||
|
||||
@@ -692,9 +692,7 @@ pub unsafe fn job_send_msg(context: &Context, msg_id: uint32_t) -> libc::c_int {
|
||||
);
|
||||
} else {
|
||||
/* unrecoverable */
|
||||
if clist_search_string_nocase(mimefactory.recipients_addr, mimefactory.from_addr)
|
||||
== 0i32
|
||||
{
|
||||
if !clist_search_string_nocase(mimefactory.recipients_addr, mimefactory.from_addr) {
|
||||
clist_insert_after(
|
||||
mimefactory.recipients_names,
|
||||
(*mimefactory.recipients_names).last,
|
||||
|
||||
Reference in New Issue
Block a user