core-c has truncated messages in the contact requests.
this is questionable in general, as
- all messages, including contact requests,
are already truncated, unquoted, simplified etc.
- the ui should be capable of showing the full text anyway
(when the contact request is accepted, the whole messase is shown)
- also, all current ui show the contact requests by name only in the
chatlist; the user often does not even come to the contact request view.
- if the ui wants to show the contact request is a special way,
it is probably better to leave this truncation up to the ui
Previously, logging macros (info! warn! error!) accepted integer
argument (data1), that was passed to callback function verbatim. In all
call sites this argument was 0.
With this change, that data1 argument is no longer part of macro
interface, 0 is always passed to callback in internals of these macros.
* Make dc_dehtml() function safe
* Change type of is_msgrmsg parameter to bool
* Narrow type of local variable in simplify_plain_text()
* Export less fields of `Simplify' record
* Demote is_cut_* from fields of `Simplify' to local variables
* Refactor part of simplify_plain_text()
Refactor footer ("-- " and similar) code into separate function,
and re-implement it with standard Rust string methods.
It simplifies code and allows removing one mutable local variable.
* Replace dc_split_into_lines with String.split()
* src/dc_simplify.rs(find_message_footer): adjust type signature to accept
slice of &str, not slice of pointers
* src/dc_simplify.rs(simplify_plain_text): adjust code to use '==' operator
instead of strcmp(3).
* src/dc_simplify.rs(is_empty_line, is_quoted_headline, is_plain_quote):
+ adjust type signatures to accept &str, not 'const char *'
+ remove no longer needed 'unsafe' qualifier
* src/dc_tools(dc_split_into_lines, dc_free_splitted_lines): remove no longer
used functions.
In addition to additional type-safety, this change reduces number of
allocations: String.split returns iterator of &str.
* Make simplify_plain_text() safe
* Make Simplify.simplify return String, not pointer
* Refactor Simplify.simplify to use String methods, not pointers
* Make Simplify.simplify() safe
* Avoid neeless allocation in Simplify.simplify when input is html
* Add tests for simplify utilities
* Document discussion about is_empty_line() discussion
* 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