mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 06:46:35 +03:00
Make dc_msg_get_summarytext_by_raw safe (#316)
* Make dc_msg_get_summarytext_by_raw safe * use dc_truncate method in all places * Fix tests and add docs to dc_truncate() * Make text argument an AsRef<&str> and rename type_0 to viewtype * Fix too early return in dc_msg_get_summarytext_by_raw. Fixes https://github.com/deltachat/deltachat-core-rust/issues/313
This commit is contained in:
@@ -166,15 +166,14 @@ pub unsafe fn dc_lot_fill(
|
||||
}
|
||||
}
|
||||
|
||||
let message_text = (*msg).text.as_ref().unwrap();
|
||||
|
||||
(*lot).text2 = dc_msg_get_summarytext_by_raw(
|
||||
(*msg).type_0,
|
||||
message_text.strdup(),
|
||||
(*msg).text.as_ref(),
|
||||
&mut (*msg).param,
|
||||
160,
|
||||
context,
|
||||
);
|
||||
)
|
||||
.strdup();
|
||||
|
||||
(*lot).timestamp = dc_msg_get_timestamp(msg);
|
||||
(*lot).state = (*msg).state;
|
||||
|
||||
Reference in New Issue
Block a user