- Use HeaderName in parsers instead of raw byte strings.
- Use byte literal constants where appropriate instead of repeating
&b"___"[..]
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
When adding contacts from an envelope view, its hash/id/key was a random
Uuidv4, so it was always possible to add a contact again and again with
no limits. Now, the id is calculated from the hash of the email address
and display name, preventing duplicate additions.
Note that the hash algorithm is not supposed to be stable across
versions, meaning that in the future the same contact might have a
different hash. This means a more sophisticated method for
detecting/disallowing dupes must eventually be introduced.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Shortcut sections are shown in order, sorted by focus--as if widgets are
stacked vertically by the order you've opened them. In some widgets that
order was wrong.
Also, when a parent widget retrieved its child shortcuts, sometimes it
overwrote children sections if they both have them. This commit adds a
sealed trait ExtendShortcutsMaps that instead of overriding them, it
merges them with the child map having the priority.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Sort with `sort <index> [asc/desc]` command or by pressing `1..5` keys.
Press them again to toggle between asc and desc.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
change_color() predated addition of Cell Attributes (Bold, Underline,
etc) so it didn't accept an attribute argument.
This commit adds a change_theme() function that does the same thing as
change_color() but also sets the cell attributes. It also takes a
ThemeAttribute as an argument instead of {fg, bg, attrs} individually.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We want to use SortOrder enum for non-thread purposes in the next
commit, so move it out of the thread module.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We inspect errors in the frontend to check for network errors. If the
network error comes from std::io, this would get converted to an Error
with description "timed out", kind OSError, and source the actual
networking error.
This commit converts network std::io::ErrorKinds into appropriate
native ErrorKinds.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit adds a Happy Eyeballs [1] implementation taken from the
happy-eyeballs crate, which is in public domain.
While the function lookup_ip[0] iterates through the addresses returned by
A and AAAA records from a DNS lookup, it returns the first one which
always is an IPv4 address, unless there only is an AAAA record.
RFC6555 [1] recommends an algorithm for choosing the fastest address to
connect to, called "Happy Eyeballs". Ꙭ
[0]: melib/src/utils/connections.rs:497
[1]: https://www.rfc-editor.org/rfc/rfc6555Fixes#268
According to RFC 3977:
> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair
This commit adds a log::error entry when any sent command exceeds that
limit and recommends the user to report this as a bug.
According to RFC 3977:
> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair
Sending a `LIST ACTIVE` command with lots of newgroups and passing the
512 byte limit is therefore invalid. This commit splits the mailboxes in
chunks and sends a separate command for each maximal chunk that has
a valid length.
Fixes#269.
Reported-by: r3k2
NNTP servers may return addresses that are not RFC 5322 compliant. An
address with a comment with non-ascii characters will make the parser loop indefinitely.
Fixes#269.