Compare commits

..

15 Commits

Author SHA1 Message Date
holger krekel
a749aee247 fix some longer standing nonsense code that sent to misleading MSG_READ events instead of one correct one 2019-08-08 20:39:29 +02:00
holger krekel
447d3c3416 (jikstra, hpk) fix a logic bug introduced with the stock-string merge which set the better message only if it was empty 2019-08-08 20:39:29 +02:00
holger krekel
a41204b275 fix a failure which blocked correctly sending out messages (dc_job_add_smtp mis-set filename) 2019-08-08 20:39:29 +02:00
dignifiedquire
df4927662d memory is hard 2019-08-08 13:07:59 +02:00
dignifiedquire
f9709eb931 try to fix swap_remove usage 2019-08-08 13:07:59 +02:00
dignifiedquire
7421aade3f try some more things 2019-08-08 13:07:59 +02:00
dignifiedquire
4cc9172ee7 print decrypted message 2019-08-08 13:07:09 +02:00
dignifiedquire
7e129bcfc3 print incoming messages 2019-08-08 13:06:08 +02:00
dignifiedquire
33246726de bytes ftw 2019-08-08 13:06:08 +02:00
dignifiedquire
3a60ada4c3 try more 2019-08-08 13:06:08 +02:00
dignifiedquire
7a3053e303 more correct bytes 2019-08-08 13:06:08 +02:00
dignifiedquire
d32f467790 forget about the memory 2019-08-08 13:06:08 +02:00
dignifiedquire
6a37ef47c0 fix nullbyte 2019-08-08 13:06:08 +02:00
dignifiedquire
56a23ddd97 add some logging 2019-08-08 13:06:08 +02:00
dignifiedquire
e882e37855 wip 2019-08-08 13:06:08 +02:00
6 changed files with 54 additions and 0 deletions

View File

@@ -909,6 +909,13 @@ unsafe fn decrypt_part(
let plain_bytes = plain.len();
let plain_buf = plain.as_ptr() as *const libc::c_char;
info!(
context,
0,
"decrypted message: '{}'",
String::from_utf8_lossy(&plain)
);
let mut index: size_t = 0i32 as size_t;
let mut decrypted_mime: *mut mailmime = 0 as *mut mailmime;
if mailmime_parse(

View File

@@ -17,6 +17,7 @@ use crate::dc_mimefactory::*;
use crate::dc_msg::*;
use crate::dc_tools::*;
use crate::imap::*;
use crate::keyhistory::*;
use crate::param::*;
use crate::sql;
use crate::types::*;
@@ -1276,6 +1277,13 @@ pub unsafe fn dc_job_send_msg(context: &Context, msg_id: uint32_t) -> libc::c_in
(*mimefactory.msg).param.set_int(Param::GuranteeE2ee, 1);
dc_msg_save_param_to_disk(mimefactory.msg);
}
dc_add_to_keyhistory(
context,
0 as *const libc::c_char,
0,
0 as *const libc::c_char,
0 as *const libc::c_char,
);
success = dc_add_smtp_job(context, 5901i32, &mut mimefactory);
}
}

View File

@@ -1189,6 +1189,17 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
.is_null())
as libc::c_int;
if !decoded_data.is_null() && decoded_data_bytes > 0 {
info!(
mimeparser.context,
0,
"Simplifying text: \n---\n{:?}\n--\n",
std::slice::from_raw_parts(
decoded_data as *const u8,
decoded_data_bytes as usize,
)
);
}
let simplified_txt = simplifier.unwrap().simplify(
decoded_data,
decoded_data_bytes as libc::c_int,
@@ -1198,6 +1209,13 @@ unsafe fn dc_mimeparser_add_single_part_if_known(
if !simplified_txt.is_null()
&& 0 != *simplified_txt.offset(0isize) as libc::c_int
{
info!(
mimeparser.context,
0,
"Simpliifed text: {}",
as_str(simplified_txt),
);
let mut part = dc_mimepart_new();
part.type_0 = 10i32;
part.int_mimetype = mime_type;

View File

@@ -991,6 +991,13 @@ impl Imap {
if !is_deleted && msg.body().is_some() {
let body = msg.body().unwrap();
info!(
context,
0,
"received message {}",
String::from_utf8_lossy(body)
);
unsafe {
(self.receive_imf)(
context,

13
src/keyhistory.rs Normal file
View File

@@ -0,0 +1,13 @@
use crate::context::Context;
/* yes: uppercase */
/* library private: key-history */
pub fn dc_add_to_keyhistory(
_context: &Context,
_rfc724_mid: *const libc::c_char,
_sending_time: u64,
_addr: *const libc::c_char,
_fingerprint: *const libc::c_char,
) {
}

View File

@@ -25,6 +25,7 @@ pub mod contact;
pub mod context;
pub mod imap;
pub mod key;
pub mod keyhistory;
pub mod keyring;
pub mod oauth2;
pub mod param;