Commit graph

2662 commits

Author SHA1 Message Date
Manos Pitsidianakis
567270e177
melib: use Vec instead of SmallVec for search results
There was no point in using SmallVec with this large a size; it was
32768 bytes, or 32KiB. Let's allocate that to the heap instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:53:15 +02:00
Manos Pitsidianakis
5af6e059b7
meli/accounts: use Arc<str> for account name
Since it gets cloned around a lot.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:53:10 +02:00
Manos Pitsidianakis
630df3083f
CI: Add arm64 runners in job matrices
Add arm64 runs on matrices of jobs that build stuff.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-24 11:49:19 +02:00
Manos Pitsidianakis
b7e215f9c2
melib/utils: fix test_fd_locks() on platforms without OFD support
Not all platforms support open file description locks.

It is part of POSIX-2024 [1] so hopefully this will improve in the future.

[1]: "The Open Group Base Specifications Issue 8 IEEE Std 1003.1-2024" <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fcntl.h.html>

Fixes #522 "utils::tests::test_fd_locks fails on macOS"

Resolves: <https://git.meli-email.org/meli/meli/issues/522>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 16:45:37 +02:00
Manos Pitsidianakis
c375b48ebf
terminal: fix Synchronized Output response parsed as input
Since 2af5c8b6fd ("terminal: add
QuerySynchronizedOutputSupport WIP") we send a synchronised output
support query [1] to the terminal but we don't parse the response. If the
terminal replies, it gets parsed as user input. And if the user happens
to press a navigation key such as scroll_down which supports a number
modifier, the `2026` part of the mode response which was parsed as user
input makes meli scroll down 2026 lines.

Fixes: #502 ("Initial navigation state in mailbox index view is wrong")

[1]:
<https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036>

Resolves: <https://git.meli-email.org/meli/meli/issues/502>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 15:49:49 +02:00
Manos Pitsidianakis
25f0a3f814
conf/terminal: fix serde of ProgressSpinnerSequence
If ProgressSpinnerSequence / progress_spinner_sequence had a value of
just an array of strings, it could not be parsed correctly. Fix that
with a custom serde impl and also add unit tests.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 15:49:49 +02:00
Manos Pitsidianakis
2bd8d7ba01
conf/tests.rs: Rename test functions to follow path convention
Rename functions to follow the convention of being prefixed with the
module path before the function name (e.g. `fn
test_module_a_module_b_test_desc() {`)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-20 11:48:08 +02:00
Manos Pitsidianakis
a27a28275b
Bump version to 0.8.8
Finally!

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-19 16:14:21 +02:00
Manos Pitsidianakis
68ec2c53a8
CHANGELOG.md: update to new format
Update commit message entries to new format, by making commit sha
monospace and bold so that they take the same width in the list.

Also, make all commit messages be surrounded by ` to show them in
monospace as well; they might not always include English words but
identifiers and abbreviations instead.

Vim substitutions used:

- %s/- [[]\(........\)[]]/- \[**`\1`**\]/

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-19 14:06:39 +02:00
Manos Pitsidianakis
f036f95eee
scripts: add generate_release_changelog_entry.sh
Add a helper script to generate a new release entry to add to
CHANGELOG.md when it's time to tag a new release.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-19 13:19:04 +02:00
Manos Pitsidianakis
7ff1db143f
manage-mailboxes: add delete option
While there was a delete-mailbox command, there was no option for it in
the manage-mailboxes interface, so add it.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-18 16:15:18 +02:00
Manos Pitsidianakis
35fa8e94a6
melib/imap: gracefully retry without DEFLATE on BYE
If server replies with BYE, try one more time without DEFLATE.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-16 11:40:41 +02:00
Manos Pitsidianakis
ecc9b4823e
Small repo cleanups
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-16 11:19:35 +02:00
Manos Pitsidianakis
707a129ea4
Coalesce repeating TUI notification messages
Don't accept new Display Messages if it has the same content as the
latest one in the display message stack.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:44 +02:00
Manos Pitsidianakis
e7a164de0c
Configure some gpgme stuff under gpgme feature
Some stuff that are only used with gpgme feature were not guarded by
 #[cfg(feature = "gpgme")], so fix that.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:08 +02:00
Manos Pitsidianakis
3040521695
melib: make notmuch feature depend on maildir feature
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:08 +02:00
Manos Pitsidianakis
e9ec6761f9
melib: make base64 dep mandatory
base64 is used in melib::backends::utf7 without any sort of conditional
compilation. Make base64 a mandatory dependency.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:07 +02:00
Manos Pitsidianakis
7b1be139f2
melib: make mbox backend build by default
Allow mbox to be built without the `notify` dependency. Add feature
`mbox-notify` to provide that instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 19:16:07 +02:00
Manos Pitsidianakis
b912aabca2
docs: add examples of file picker usage
Add an example for `fzf` use with the `add-attachment-file-picker < `
command when composing e-mail.

Closes #507

Resolves: <https://git.meli-email.org/meli/meli/issues/507>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-15 12:27:53 +02:00
Manos Pitsidianakis
0e77bd5b4c
melib/email/compose/tests: add multipart mixed attachment test
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-14 20:35:53 +02:00
Manos Pitsidianakis
d5d3457914
melib/email/compose/tests: normalise test fn names
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-14 19:31:06 +02:00
Manos Pitsidianakis
c1901c962d
melib/email/compose: add Content-Type header for utf8 text plain attachments
We should be specifying that the charset is utf-8.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-14 19:30:26 +02:00
Manos Pitsidianakis
d21c686da7
melib/attachments: Make AttachmentBuilder::set_raw generic
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-14 19:28:36 +02:00
Manos Pitsidianakis
bcbcb012ef
melib/email/compose: ensure boundary always prefixed with CRLF
When printing multipart boundaries, e.g.
`--bzz_bzz__bzz__xxxxxxxxxxxxxxxxxxxxxxxxxxx` after ending a sub-part,
ensure there's a CRLF already at the end of the accumulator string
before adding the `--...` boundary tag.

Fixes #503 ("Sending attachments does not work properly")

Resolves: <https://git.meli-email.org/meli/meli/issues/503>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-14 18:29:16 +02:00
Manos Pitsidianakis
cb2dd5def5
listing/threaded: impl missing select functionality
Selecting by searching for was missing for the threaded index style, so
add it.

Related to #513

Resolves: <https://git.meli-email.org/meli/meli/issues/513>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-11 00:55:17 +02:00
Manos Pitsidianakis
c6e9e4245d
listing/threaded: impl missing filter functionality
Somehow, filter (searching) was not implemented for the threaded index
style, so fix it.

Fixes: #513

Resolves: <https://git.meli-email.org/meli/meli/issues/513>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-11 00:41:12 +02:00
Manos Pitsidianakis
320fddad41
melib/gpgme: disable layout tests on non-x86_64 hosts
The generated bindgen layout tests make hard-coded assumptions about
target specific sizes like pointers, let's disable them for now before
we figure out a better long-term solution for gpgme compatibility.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 23:04:11 +02:00
Manos Pitsidianakis
d2559e42e5
imap: return all mailboxes, not just subscribed ones
Meli previously returned only subscribed mailboxes for IMAP. This was
erroneous behavior for two reasons:

- the front end should be able to see all mailboxes because the user is
  allowed to change subscription settings for remote mailboxes from the
  manage-mailboxes interface
- special usage mailboxes, e.g. a Trash folder, would not be visible to
  meli if it was not subscribed

Fixes #508.

Resolves: <https://git.meli-email.org/meli/meli/issues/508>
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:40 +02:00
Manos Pitsidianakis
2411481196
manage: parse scroll_{left,right} actions
They were previously silently ignored despite tables (DataColumns)
having support for scrolling on the x axis.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:40 +02:00
Manos Pitsidianakis
789a88b28d
shortcuts: add select_motion equivalent to select_entry
Change select_entry to toggle only one's selection entry (default 'V'),
while select_motion (default 'v') inherits the original functionality of
  performing a select motion when combined with a number and motion verb
  (scroll up/down etc)

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:40 +02:00
Manos Pitsidianakis
ad79bf84c2
.gitea/Makefile.lint: attempt cargo-fmt with +nightly
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:40 +02:00
Manos Pitsidianakis
81ace71b35
terminal/embedded: lift error checking earlier
Lift error checks earlier in the function, before forking, allowing any
potential errors to show up properly in the main process.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:39 +02:00
Manos Pitsidianakis
469168959f
melib/gpgme: s/NULL/NUL when referring to NUL byte
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:39 +02:00
Manos Pitsidianakis
50922d97b8
melib/README.md: update and fix feature table
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:39 +02:00
Manos Pitsidianakis
0d088962d5
lints: Address clippy::too_long_first_doc_paragraph
Ugh, annoying. It doesn't take the fact that markdown links do not
appear long when rendered. Anyway, fix them errors.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 15:13:39 +02:00
Manos Pitsidianakis
ee89794248
lints: deny clippy::or_fun_call
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 14:29:40 +02:00
Manos Pitsidianakis
441fda568c
terminal: move TextPresentation trait to melib
Since this is a text-related trait, let's move this to melib's text module
instead.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:33 +02:00
Manos Pitsidianakis
f656aff08e
composer: add discard-draft command
Add command to discard draft and close the composer tab immediately.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:32 +02:00
Manos Pitsidianakis
3a93103520
command: move Composer actions under TabActions
Semantically Composer actions should be tab actions since a composer is
a tab. Move them to a new enum in preparation for the next commit which
adds a new Discard draft action.

No functional change intended.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:32 +02:00
Manos Pitsidianakis
3558db514a
Move jobs and mailbox management Components together
Move the components for :manage-jobs and :manage-mailboxes into the same
submodule, `manage`. No functional change intended.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:32 +02:00
Manos Pitsidianakis
dba5b68be8
components: add prelude module
Add prelude module with exports that are commonly necessary for
Component types.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-11-04 13:40:31 +02:00
Manos Pitsidianakis
6c315580b1
compose: fix add-attachment-file-picker
Related to #507

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-24 21:09:18 +03:00
Manos Pitsidianakis
1b708a9990
melib: attempt FromSql from Blob for u64 hash
Attempt to parse u64 hash from Blob column type. This is to fix a
regression from the frontend storing envelope hashes as big endian byte
blobs instead of an i64.

Fixes #504

Resolves: https://git.meli-email.org/meli/meli/issues/504
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-16 21:06:56 +03:00
Manos Pitsidianakis
05f404ba1f
jobs: do not use AtomicU64
AtomicU64 is not portable, unfortunately.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-16 21:03:43 +03:00
Manos Pitsidianakis
ae29494575
remove unused module file
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-14 16:04:38 +03:00
Manos Pitsidianakis
b2200ec3ab
Remove unused smtp tests
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-07 12:35:56 +03:00
Manos Pitsidianakis
c3cac77dee
Update imap-codec dependency to 2.0.0-alpha.4
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-07 12:35:56 +03:00
Manos Pitsidianakis
27486f2908
Accept newer versions of base64 dependency
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-07 12:35:56 +03:00
Manos Pitsidianakis
6cfe4da0c1
Enable rusqlite feature "modern_sqlite" always
Crate fails to build when dynamically linked.
The feature is implicitly enabled when statically linked,
as part of feature bundled-full.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-05 19:50:58 +03:00
Manos Pitsidianakis
77e7c3df60
Add support for signatures
Add config values to `composing` config section to enable signatures:

   signature_file Path                   (optional) Plain text file with signature that will pre-populate an email draft.  Signatures must be explicitly enabled to be used, otherwise this setting will be ignored.  (None)

   use_signature bool                    Pre-populate email drafts with signature, if any.  meli will lookup the signature value in this order:
                                         1.   The signature_file setting.
                                         2.   ${XDG_CONFIG_DIR}/meli/<account>/signature
                                         3.   ${XDG_CONFIG_DIR}/meli/signature
                                         4.   ${XDG_CONFIG_DIR}/signature
                                         5.   ${HOME}/.signature
                                         6.   No signature otherwise.
                                         (false)

   signature_delimiter String            (optional) Signature delimiter, that is, text that will be prefixed to your signature to separate it from the email body.  (‘\n\n-- \n’)

Closes #498

Resolves: https://git.meli-email.org/meli/meli/issues/498
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-10-05 18:50:02 +03:00