mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +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
|
1
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO should return bool /rtn
|
pub unsafe fn dc_mimeparser_is_mailinglist_message(mimeparser: &dc_mimeparser_t) -> bool {
|
||||||
pub unsafe fn dc_mimeparser_is_mailinglist_message(mimeparser: &dc_mimeparser_t) -> libc::c_int {
|
|
||||||
if !dc_mimeparser_lookup_field(&mimeparser, "List-Id").is_null() {
|
if !dc_mimeparser_lookup_field(&mimeparser, "List-Id").is_null() {
|
||||||
return 1i32;
|
return true;
|
||||||
}
|
}
|
||||||
let precedence: *mut mailimf_optional_field =
|
let precedence: *mut mailimf_optional_field =
|
||||||
dc_mimeparser_lookup_optional_field(mimeparser, "Precedence");
|
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,
|
b"bulk\x00" as *const u8 as *const libc::c_char,
|
||||||
) == 0i32
|
) == 0i32
|
||||||
{
|
{
|
||||||
return 1i32;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
0
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_mimeparser_sender_equals_recipient(mimeparser: &dc_mimeparser_t) -> libc::c_int {
|
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 {
|
if *chat_id == 0 {
|
||||||
// check if the message belongs to a mailing list
|
// 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;
|
*chat_id = 3;
|
||||||
info!(
|
info!(
|
||||||
context,
|
context,
|
||||||
@@ -1258,7 +1258,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
.get_config(context, "configured_addr")
|
.get_config(context, "configured_addr")
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
if chat_id == 0
|
if chat_id == 0
|
||||||
&& 0 == dc_mimeparser_is_mailinglist_message(mime_parser)
|
&& !dc_mimeparser_is_mailinglist_message(mime_parser)
|
||||||
&& !grpid.is_empty()
|
&& !grpid.is_empty()
|
||||||
&& !grpname.is_null()
|
&& !grpname.is_null()
|
||||||
// otherwise, a pending "quit" message may pop up
|
// 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
|
// 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
|
// too few contacts or a mailinglist
|
||||||
cleanup(
|
cleanup(
|
||||||
grpname,
|
grpname,
|
||||||
|
|||||||
Reference in New Issue
Block a user