Commit Graph

26 Commits (master)

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>
2024-03-24 15:14:20 +02:00
Manos Pitsidianakis 0b468d88ad
addressbook/vcard: improve Error messages
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2024-02-04 14:52:06 +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 5c2b04719b
Normalize std::fmt::* imports
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Failing after 7m42s Details
2023-08-11 13:16:47 +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 5634f95553 Rename MeliError struct to Error 2022-12-08 22:20:05 +02:00
Manos Pitsidianakis c3fdafde3b Documentation touchups 2022-09-26 18:04:53 +03:00
Manos Pitsidianakis 5f003a31be
melib/addressbook/vcard: Parse vCards with just LF instead of CRLF line endings
According to the vcard RFC
https://datatracker.ietf.org/doc/html/rfc6350#section-3.2 all lines must
end with CRLF (\r\n or 0x0d 0x0a)

Some VCard sources use only newline, which, while spec violating is easy
to recover from. So parse them as if they are correct.

Closes #121
2021-10-24 14:31:22 +03: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 bf9143d8e4
melib/datetime: use Cow<'_, CStr> in timestamp_to_string()
Use Cow to avoid unnecessary allocations when provided a nul-terminated
format string
2021-01-08 15:01:37 +02:00
Manos Pitsidianakis a7e177586a
Fix clippy lints 2020-07-06 15:27:08 +03:00
Manos Pitsidianakis eb701695f7
Remove fnv crate 2020-05-10 21:18:56 +03:00
Manos Pitsidianakis 5d07a5147b
datetime: fix panic on invalid cstr conversion 2020-05-06 18:46:38 +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 689327651f
melib/vcard: add parser for vcard files 2019-11-27 01:46:23 +02:00
Manos Pitsidianakis a907b9c21d
Fix melib test errors 2019-11-09 18:10:22 +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 04411f1003
rename 'mod.rs' files
closes #53
2019-06-10 19:40:37 +03:00
Manos Pitsidianakis 92bb3bf8d3
ui: add contacts and account panel 2019-06-10 19:40:36 +03:00