Module deltachat::simplify

source ·
Expand description

§Simplify incoming plaintext.

Structs§

  • Simplified text and some additional information gained from the input.

Functions§

  • Protects lines starting with -- against being treated as a footer. for that, we insert a ZERO WIDTH SPACE (ZWSP, 0x200B); this should be invisible on most systems and there is no need to unescape it again (which won’t be done by non-deltas anyway).
  • Returns true if the line contains only whitespace.
  • Remove footers if any. This also makes all newlines “\n”, but why not.
  • Remove standard (RFC 3676, §4.3) footer if it is found. Returns (lines, footer_lines) tuple; footer_lines is set to Some if the footer was actually removed from lines (which is equal to the input array otherwise).
  • Remove nonstandard footer and a boolean indicating whether such footer was removed. Returns (lines, is_footer_removed) tuple; is_footer_removed is set to true if the footer was actually removed from lines (which is equal to the input array otherwise).
  • simplify 🔒
    Simplify message text for chat display. Remove quotes, signatures, trailing empty lines etc.
  • Skips “forwarded message” header. Returns message body lines and a boolean indicating whether a message is forwarded or not.