Commit Graph

33 Commits (master)

Author SHA1 Message Date
Manos Pitsidianakis 8ec6f22090
Use ShellExpandTrait::expand in more user-provided paths
ShellExpandTrait::expand was not used consistently, leading to only some
functionalities supporting things like tilde expansion.

Fixes #387

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-05-06 18:33:43 +03:00
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>
2024-03-24 15:14:20 +02:00
Manos Pitsidianakis f900dbea46
Use cargo-derivefmt to sort derives alphabetically
Used https://github.com/dcchut/cargo-derivefmt

With command:

cargo install --locked \
--git https://github.com/dcchut/cargo-derivefmt \
--bin cargo-derivefmt \
--rev 2ff93de7fb418180458dd1ba27e5655607c23ab6

Since it's not on crates.io at the moment.

Sample diff:

  -#[derive(Debug, Deserialize, Clone, Serialize)]
  +#[derive(Clone, Debug, Deserialize, Serialize)]

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-12-09 21:28:12 +02:00
Manos Pitsidianakis a337e2269e
contacts: refactor module structure
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 8m14s Details
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 13m51s Details
To prepare for more functionality, refactor contacts module.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2023-08-30 01:12:45 +03:00
Manos Pitsidianakis 3963103d55
contacts: prevent duplicate contact creation
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 8m9s Details
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>
2023-08-23 17:29:21 +03:00
Manos Pitsidianakis 5f29faa640
melib: clippy lint fixes 2023-07-03 09:38:47 +03:00
Manos Pitsidianakis 5699baecfb
melib: add utils::{futures, random} 2023-06-19 10:01:02 +03:00
Manos Pitsidianakis 85d4316a6a
Replace old logging module with the `log` create 2023-05-01 16:22:35 +03:00
Manos Pitsidianakis b1a7188771
Clippy fixes 2023-04-30 20:47:53 +03:00
Manos Pitsidianakis 2878bbb8c8 melib/addressbook: add parser for mutt alias file 2022-12-23 02:32:22 +02:00
Manos Pitsidianakis bd22f986f0 melib: fix clippy lints 2022-11-14 19:14:19 +02:00
Manos Pitsidianakis 2580522931
melib/addressbook: log vcard parsing failures 2021-10-24 14:18:29 +03:00
Manos Pitsidianakis 733de5a5fb
Fix some clippy suggestions 2021-09-12 14:33:00 +03:00
Manos Pitsidianakis 3dba6fdf60
melib/datetime: add posix locale arg in timestamp_to_string() 2021-01-08 15:01:37 +02:00
Manos Pitsidianakis c6c0da7fcb
melib: cleanup commit
Cleanup melib module exports, add some document tests, change some
documentation.
2020-09-10 21:19:38 +03:00
Manos Pitsidianakis eb701695f7
Remove fnv crate 2020-05-10 21:18:56 +03:00
Manos Pitsidianakis c0ac643f05
melib: add datetime module
Datetime module adds POSIX time functions interface
2020-01-06 16:10:36 +02:00
Manos Pitsidianakis afff63c781
ui: load vcards to addressbook with vcard_folder account setting 2019-11-27 17:42:11 +02:00
Manos Pitsidianakis 5beed91df2
contacts: add support for externally managed contacts
Adds support for contacts (Cards) marked as `external_resource` which
prevents modifications from happening. No way to import external
contacts is added yet.
2019-10-20 11:32:31 +03:00
Manos Pitsidianakis dc525b9ddd
contacts: make CardId an enum
CardId is the "Primary Key" of the contact type, Card. Meli-created
contacts had UUIDs for their CardId. In order to import external
contacts and ensure their primary key is the same each time, CardId is
made into an enum to add hashing as a choice.
2019-10-20 11:25:57 +03:00
Manos Pitsidianakis cfe6138c44
melib: add VCard parsing for contacts
Add rough VCard conversion for melib::Card, to use eventually with
contacts.
2019-10-16 14:57:48 +03:00
Manos Pitsidianakis 24831b3c13
Fix warnings, lints, and 2018 errors 2019-06-18 21:14:14 +03:00
Manos Pitsidianakis d772d10d66
merge FirstName/LastName fields in Contacts
First names and Last names are an anglocentric concept and do not apply
cleanly to the rest of the world's cultures.
2019-06-10 19:40:51 +03:00
Manos Pitsidianakis 5d9af8e32b
ui: improve contact additions from mail view 2019-06-10 19:40:41 +03:00
Manos Pitsidianakis bf038428c2
Run rustfmt 2019-06-10 19:40:39 +03:00
Manos Pitsidianakis b1d25e6d8d
add autocomplete suggestions in field 2019-06-10 19:40:39 +03:00
Manos Pitsidianakis 5e306130fb
Fix clippy warnings 2019-06-10 19:40:39 +03:00
Manos Pitsidianakis e285d1006b
Open Contacts list from accounts tab 2019-06-10 19:40:38 +03:00
Manos Pitsidianakis 00abea5bff
Make Entity `Send` 2019-06-10 19:40:38 +03:00
Manos Pitsidianakis c135650018
Add Contact edit
concerns #11
2019-06-10 19:40:37 +03:00
Manos Pitsidianakis bbaf87e345
Add type synonyms for Uuids
closes 58
2019-06-10 19:40:37 +03:00
Manos Pitsidianakis 62168e9183
Add contact view page, edit headers in compose, index style in conf 2019-06-10 19:40:37 +03:00
Manos Pitsidianakis 04411f1003
rename 'mod.rs' files
closes #53
2019-06-10 19:40:37 +03:00