EmailBodyPart required partId and blobId to be non-null, which is
invalid. Make them Option<_>s instead.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Instead of using the actual maxObjectsInGet batch size when fetching
email, use min(maxObjectsInGet, 500). This makes things not time-out
this easily when the maxObjectsInGet is large (e.g. 4096)
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
JMAP code should be using if_in_state wherever possible, to detect
mismatch between current server state and current client state.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
make_address! macro was called with a .take() expression, which was
substituted in the macro more than once hence take() would be called
more than once.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
It appears icloud IMAP servers do not support fetching RFC822 items with
the FETCH command. They reply to the fetch successfully but with the
item missing. To support this clearly non-standard and buggy behavior,
retry one more time by fetching with BODY[] instead if the RFC822 is
missing.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Stable release 1.80.0 has a regression causing compilation errors:
error[E0282]: type annotations needed for `Box<_>`
Pin stable version to 1.79.0, since we don't need anything later than
our MSRV anyway.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
While the timeout value was parsed, it was only used for mutex lock
timeouts and not the http connection.
This commit sets the isahc HTTP connections timeouts using the value, if
provided.
Fixes#422
Resolves: https://git.meli-email.org/meli/meli/issues/422
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Not yet seen behavior is unreliable and leads to false unread counts.
Set it to 0 instead when inserting an existing count.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add consumption of undercurl escape codes without parsing colors, as
there is no support for that in Cell yet.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Set error kind to NotFound instead of Bug, since it is possible a
mailbox state is not cached. Also add convenience function
ignore_not_found() that converts NotFound Err Results to Ok(()).
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
cargo-msrv verify was verifying only library/binary targets, and missed
the test targets. Specify the check command to use so that all targets
are checked.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Commit 814af0e94d broke compilation with MSRV, it was not caught by CI
tests because they do not check the test targets for MSRV verification.
Fixes: 814af0e94d ("meli/args: add --gzipped flag to man subcommand")
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
`timeout` while valid was not checked in the validate() function, so it
could not be used: the validation would reject it.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
- Building with sqlite3 non-bundled may result in compile-time error if
the system version is not new enough; the bindgen feature must be
enabled to create ffi bindings from the system version.
- Some unused code warnings show up if some features are disabled,
refactor code to make them go away.
- Update libloading to 0.8 to prevent dual dependencies in
Cargo.lock (rusqlite's bundled feature requires it)
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Accept "-" operand in create_config and test_config subcommands as
stdout and stdin respectively.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Add --gzipped flag to print a manpage without decompressing it, for
piping the output to a file. Because why not.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Move execution of opt.subcommand, if it is given, in a method of the Opt
struct. The main() function is already too long given that it sets up
and handles the event loop, so this reduces the complexity a bit.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Last digit of unread counts when showing scroll bar was overwritten by
scroll bar. If scroll bar is visible, shift the unread count one column
to the left.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Configuration entries `use_token` and `timeout` were not included in the
JMAP section so add them.
Related to #422
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Let the widget decide how much area it needs instead of providing a
limited subsection. On small screens it can lead to not enough space.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Instead of providing the horizontal range to draw as x_start and x_end
values, provide a range instead. This is to ensure that when you want to
draw from a bounds/row iterator, which has a col() method that returns
std::ops::Range<usize>, you don't end up drawing from col().start up to
including col().end like I foolishly did.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
.. And not just the ones defined in the configuration. Previously, it'd
only work if the mailbox was defined in the configuration file.
Also, make it so that the default mailbox is selected when meli is first
invoked, not just when changing to another account later.
Fixes#350
Resolves: https://git.meli-email.org/meli/meli/issues/350
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Paths entered via command were not expanded as soon as the text was
converted into a PathBuf, but when the save-to-file function was called.
This resulted in tilde expansion not happening until then, which because
of buggy behavior the previous commit fixed (expanding the tilde in the
middle of a path and pushing it to an existing path overwrites its
value, because expanding the tilde usually results in an absolute path),
resulted in the correct behavior. The invalid path was still visible on
the success message.
Instead, expand the path right away and then do modifications like
setting filename etc.
Fixes: #431
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
ShellExpandTrait was not expanding paths properly: tilde was expanded
even if it wasn't the first byte in the sequence. Since $HOME tends to
be an absolute path, the entire value of the path accumulator up till
that point was overwritten, meaning a /path/to/~/some/file would get
expanded to ${HOME}/some/file.
ShellExpandTrait was also not completing paths properly, especially
between the generic impl and the linux specialized one. This commit adds
test to make sure their behavior is synced and changes the result type
to an enum to make the result more descriptive.
Concerns #431.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Update in v0.8.5 required changes to serialization code;
toml::to_string() now serializes TOML documents, not values.
This commit replaces all occurances with toml::Value serializations.
Fixes: 8fff7401 ("Update yanked zerocopy dependency")
Closes: #429
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Refactor to remove unwraps and add None checks with returning errors
where appropriate.
Hopefully addresses #426
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
RowsState::rename_env was not updating all EnvelopeHash related fields
when a receiving an EnvelopeRename event, which can cause panics if the
listing tries to index it.
Concerns #426
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>