mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
Make dc_mimeparser_is_mailinglist_message() return bool, not int
This commit is contained in:
committed by
Floris Bruynooghe
parent
6fcd6419bd
commit
b3df24d188
@@ -1453,10 +1453,9 @@ pub unsafe fn mailmime_transfer_decode(
|
||||
1
|
||||
}
|
||||
|
||||
// TODO should return bool /rtn
|
||||
pub unsafe fn dc_mimeparser_is_mailinglist_message(mimeparser: &dc_mimeparser_t) -> libc::c_int {
|
||||
pub unsafe fn dc_mimeparser_is_mailinglist_message(mimeparser: &dc_mimeparser_t) -> bool {
|
||||
if !dc_mimeparser_lookup_field(&mimeparser, "List-Id").is_null() {
|
||||
return 1i32;
|
||||
return true;
|
||||
}
|
||||
let precedence: *mut mailimf_optional_field =
|
||||
dc_mimeparser_lookup_optional_field(mimeparser, "Precedence");
|
||||
@@ -1470,11 +1469,11 @@ pub unsafe fn dc_mimeparser_is_mailinglist_message(mimeparser: &dc_mimeparser_t)
|
||||
b"bulk\x00" as *const u8 as *const libc::c_char,
|
||||
) == 0i32
|
||||
{
|
||||
return 1i32;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
0
|
||||
false
|
||||
}
|
||||
|
||||
pub unsafe fn dc_mimeparser_sender_equals_recipient(mimeparser: &dc_mimeparser_t) -> libc::c_int {
|
||||
|
||||
@@ -445,7 +445,7 @@ unsafe fn add_parts(
|
||||
|
||||
if *chat_id == 0 {
|
||||
// check if the message belongs to a mailing list
|
||||
if 0 != dc_mimeparser_is_mailinglist_message(mime_parser) {
|
||||
if dc_mimeparser_is_mailinglist_message(mime_parser) {
|
||||
*chat_id = 3;
|
||||
info!(
|
||||
context,
|
||||
@@ -1258,7 +1258,7 @@ unsafe fn create_or_lookup_group(
|
||||
.get_config(context, "configured_addr")
|
||||
.unwrap_or_default();
|
||||
if chat_id == 0
|
||||
&& 0 == dc_mimeparser_is_mailinglist_message(mime_parser)
|
||||
&& !dc_mimeparser_is_mailinglist_message(mime_parser)
|
||||
&& !grpid.is_empty()
|
||||
&& !grpname.is_null()
|
||||
// otherwise, a pending "quit" message may pop up
|
||||
@@ -1493,7 +1493,7 @@ unsafe fn create_or_lookup_adhoc_group(
|
||||
};
|
||||
|
||||
// build member list from the given ids
|
||||
if to_ids.is_empty() || 0 != dc_mimeparser_is_mailinglist_message(mime_parser) {
|
||||
if to_ids.is_empty() || dc_mimeparser_is_mailinglist_message(mime_parser) {
|
||||
// too few contacts or a mailinglist
|
||||
cleanup(
|
||||
grpname,
|
||||
|
||||
Reference in New Issue
Block a user