Commit Graph

22 Commits (974502c6ffa263c8cfebf40c46b8694dce7fe982)

Author SHA1 Message Date
Manos Pitsidianakis 974502c6ff
melib/addressbook: impl Hash for Card
Implement hashing for Card.

This fixes the appearance of duplicate entries in the add contacts
selector in an envelope view when an address appears more than one time
in the envelope headers.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2 months ago
Manos Pitsidianakis 3e9144657b
meli: store children process metadata
Store children process metadata. Pid and command lines can then be shown
in the UI and in logs.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2 months ago
Manos Pitsidianakis e2cdebe89c
Add option to highlight self in mailing list threads
Use under `listing` options such as:

globally
========

  [listing]
  highlight_self = true

per-account
===========

  [accounts.work]
  root_mailbox = '[Gmail]'
  format = "imap"
  subscribed_mailboxes = ["*"]
  listing.index_style = "compact"
  listing.highlight_self = true

per-mailbox
===========

  [accounts.work.mailboxes]
  "INBOX/Lists/project-devel" = { listing.highlight_self=true }

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
3 months ago
Manos Pitsidianakis 1eca34b398
Set lowest priority to shortcut command UIEvents
Commit (a37d5fc1 conf/shortcuts: implement
a key to command mapping) introduced shortcuts that expand to user
defined commands. To allow already existing shortcuts to take
precedence, the check for the user-defined shortcuts should be the last
one in the evaluation order.

Example problem scenario:
- Press new_mail shortcut (e.g. `m`)
- Code in listing.rs searches if it matches any of the commands, and
  regardless if it matches or not, stops the evaluation and returns.
- New mail composer never shows up.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
4 months ago
Guillaume Ranquet a37d5fc1d1 conf/shortcuts: implement a key to command mapping
Permits users to map keys in their configuration file to an array of meli commands

e.g:
[shortcuts.listing]
commands = [ { command = [ "tag remove trash", "flag unset trash" ], shortcut = "D" },
             { command = [ "tag add trash", "flag set trash" ], shortcut = "d" } ]

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
5 months ago
Manos Pitsidianakis 7861fb0402
Fix typos found with `typos` tool
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis 8185f2cf7d
meli: add deny clippy lints and fix them
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis f63774fa6d
Fix new clippy lints (1.75)
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis 3b4acc15a5
view/filters: add tests
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
6 months ago
Manos Pitsidianakis 23c15261e7
mail/view: abstract envelope view filters away
Modularize an envelope view by introducing a stack of "view filters".

Example uses:

- html email can have a view on top of it that is plain text conversion
- selecting and viewing text/* attachments is just appending a new filter at
  the stack

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
6 months ago
Manos Pitsidianakis 3495ffd61b
types: Change UIEvent::Notification structure
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
6 months ago
Manos Pitsidianakis e0adcdfe15
terminal/cells: move rest of methods under CellBuffer
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
6 months ago
Manos Pitsidianakis 6506fffb94
Rewrite email flag modifications
Flag and tag modifications are now somewhat typed better, and the
frontend applies them on its own on success. This means that if you set
an unseen mail as seen but it was already seen in the backend, you will
see the change locally. Previously it would remain unseen.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
6 months ago
Manos Pitsidianakis 73b3ed559d
mail/view: fix forward dialog not workng
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis b673af02ac
accounts.rs: move to crate root
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis f0075b86cf
ui: show descriptive tab names for composer and threads
Instead of showing the nondescript tab names in the tab area,
use Subject or To: data from the draft in the composer and a subject
from the thread entries.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 49c36009ce
mail/view: don't initialize entire thread at once
For large threads, this would result in a lot of futures being created.
The user just wants to read one entry, not all of them. So prioritize
the open entry and some of the latest ones as an optimistic
pre-fetching.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis c7825c76c3
mail/view: handle dialog Esc in the parent component
Dialogues handled Esc themselves, which meant the event didn't bubble up
to their parent to let them know they should remove the dialogue. This
commit fixes that.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 3344a8dbf6
mail/view: remove unnecessary Clone derives
There's no need to clone MailViews when opening them in new tabs,
just initialize new ones with the same metadata. That saves us the
trouble of implementing Clone for all related types.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 3963103d55
contacts: prevent duplicate contact creation
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>
9 months ago
Manos Pitsidianakis 52874f9a97
mail/view: cancel previous jobs on MailView drop/update
When MailView loads a new thread or gets dropped, cancel all pending
jobs.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
10 months ago
Manos Pitsidianakis 7c9a4b4b7c
meli: Move components/mail -> mail 10 months ago