From 072f488d8971f0b3a3f196a1d4a9d2c12a53edc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Thu, 20 Apr 2023 12:12:33 +0200 Subject: [PATCH] replace himalaya-lib by pimalaya-email --- CHANGELOG.md | 3 +- Cargo.lock | 82 ++++++++++++++++---------------- Cargo.toml | 23 ++++----- README.md | 40 ++++++++-------- src/config/config.rs | 8 ++-- src/config/prelude.rs | 6 +-- src/config/wizard/imap.rs | 2 +- src/config/wizard/maildir.rs | 2 +- src/config/wizard/notmuch.rs | 2 +- src/config/wizard/sendmail.rs | 2 +- src/config/wizard/smtp.rs | 2 +- src/domain/account/args.rs | 2 +- src/domain/account/config.rs | 6 +-- src/domain/account/handlers.rs | 8 ++-- src/domain/email/handlers.rs | 4 +- src/domain/envelope/envelope.rs | 4 +- src/domain/envelope/envelopes.rs | 4 +- src/domain/flag/args.rs | 2 +- src/domain/flag/flag.rs | 16 +++---- src/domain/flag/flags.rs | 4 +- src/domain/flag/handlers.rs | 2 +- src/domain/folder/folder.rs | 4 +- src/domain/folder/folders.rs | 4 +- src/domain/folder/handlers.rs | 4 +- src/domain/imap/handlers.rs | 2 +- src/domain/tpl/handlers.rs | 2 +- src/main.rs | 2 +- src/printer/print.rs | 2 +- src/printer/print_table.rs | 2 +- src/ui/editor.rs | 4 +- src/ui/table/table.rs | 2 +- 31 files changed, 128 insertions(+), 124 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f6332f..d667a1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [sourcehut#60]. - Replaced reply all `-a` argument with `-A` because it conflicted with the global option `-a|--account`. +- Replaced `himalaya-lib` by `pimalaya-email`. ### Fixed @@ -58,7 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Changed the location of the - [documentation](https://pimalaya.org/himalaya/docs/). + [documentation](https://pimalaya.org/himalaya/). ### Fixed diff --git a/Cargo.lock b/Cargo.lock index f5c8336..ba17388 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -785,10 +785,10 @@ dependencies = [ "email_address", "env_logger", "erased-serde", - "himalaya-lib", "indicatif", "log", "once_cell", + "pimalaya-email", "serde", "serde_json", "shellexpand", @@ -801,45 +801,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "himalaya-lib" -version = "0.6.0" -source = "git+https://git.sr.ht/~soywod/himalaya-lib?branch=develop#7b8fb1d073b66d2f1d642df109c787ba3c31378f" -dependencies = [ - "ammonia", - "chrono", - "convert_case", - "dirs", - "html-escape", - "imap", - "imap-proto", - "lettre", - "log", - "mail-parser", - "maildir", - "mailparse", - "md5", - "mime-msg-builder", - "native-tls", - "notmuch", - "once_cell", - "ouroboros", - "proc-lock", - "rayon", - "regex", - "rfc2047-decoder", - "rusqlite", - "rustls", - "rustls-native-certs", - "shellexpand", - "thiserror", - "tree_magic", - "urlencoding", - "utf7-imap", - "uuid", - "webpki-roots", -] - [[package]] name = "hostname" version = "0.3.1" @@ -1225,7 +1186,8 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mime-msg-builder" version = "0.1.0" -source = "git+https://git.sr.ht/~soywod/mime-msg-builder?branch=develop#1f61083ba7811bf261647056e63441d2f997113c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3981dce6db3e7f9faa1124409a6b94436902ecb2670f374d361789d61eb34ac" dependencies = [ "ammonia", "chumsky 0.9.0", @@ -1544,6 +1506,44 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pimalaya-email" +version = "0.6.0" +dependencies = [ + "ammonia", + "chrono", + "convert_case", + "dirs", + "html-escape", + "imap", + "imap-proto", + "lettre", + "log", + "mail-parser", + "maildir", + "mailparse", + "md5", + "mime-msg-builder", + "native-tls", + "notmuch", + "once_cell", + "ouroboros", + "proc-lock", + "rayon", + "regex", + "rfc2047-decoder", + "rusqlite", + "rustls", + "rustls-native-certs", + "shellexpand", + "thiserror", + "tree_magic", + "urlencoding", + "utf7-imap", + "uuid", + "webpki-roots", +] + [[package]] name = "pin-project-lite" version = "0.2.9" diff --git a/Cargo.toml b/Cargo.toml index 9c64cee..21f5b04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "himalaya" -description = "Command-line interface for email management." +description = "CLI to manage your emails." version = "0.7.1" authors = ["soywod "] edition = "2021" license = "MIT" categories = ["command-line-interface", "command-line-utilities", "email"] keywords = ["cli", "mail", "email", "client", "imap"] -homepage = "https://github.com/soywod/himalaya" -documentation = "https://github.com/soywod/himalaya/wiki" +homepage = "https://pimalaya.org/himalaya/" +documentation = "https://pimalaya.org/himalaya/" repository = "https://github.com/soywod/himalaya" [package.metadata.deb] @@ -19,19 +19,19 @@ section = "mail" default = ["imap-backend", "smtp-sender", "native-tls"] # backends -imap-backend = ["himalaya-lib/imap-backend"] -notmuch-backend = ["himalaya-lib/notmuch-backend"] +imap-backend = ["pimalaya-email/imap-backend"] +notmuch-backend = ["pimalaya-email/notmuch-backend"] # senders -smtp-sender = ["himalaya-lib/smtp-sender"] +smtp-sender = ["pimalaya-email/smtp-sender"] # native tls -native-tls = ["himalaya-lib/native-tls"] -native-tls-vendored = ["himalaya-lib/native-tls-vendored"] +native-tls = ["pimalaya-email/native-tls"] +native-tls-vendored = ["pimalaya-email/native-tls-vendored"] # rustls -rustls-tls = ["himalaya-lib/rustls-tls"] -rustls-native-certs = ["himalaya-lib/rustls-native-certs"] +rustls-tls = ["pimalaya-email/rustls-tls"] +rustls-native-certs = ["pimalaya-email/rustls-native-certs"] [dev-dependencies] tempfile = "3.3" @@ -49,7 +49,8 @@ dialoguer = "0.10.2" email_address = "0.2.4" env_logger = "0.8" erased-serde = "0.3" -himalaya-lib = { git = "https://git.sr.ht/~soywod/himalaya-lib", branch = "develop" } +# pimalaya-email = { git = "https://git.sr.ht/~soywod/pimalaya/email" } +pimalaya-email = { path = "/home/soywod/sourcehut/pimalaya/email" } indicatif = "0.17" log = "0.4" once_cell = "1.16.0" diff --git a/README.md b/README.md index a494021..15ff35c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # 📫 Himalaya [![GitHub release](https://img.shields.io/github/v/release/soywod/himalaya?color=success)](https://github.com/soywod/himalaya/releases/latest) [![Matrix](https://img.shields.io/matrix/pimalaya.himalaya:matrix.org?color=success&label=chat)](https://matrix.to/#/#pimalaya.himalaya:matrix.org) -Himalaya is a CLI based on the -[himalaya-lib](https://git.sr.ht/~soywod/himalaya-lib) that allows you -to manipulate your emails using commands in your console. +https://pimalaya.org/himalaya/ + +CLI to manage your emails, based on the +[pimalaya-email](https://sr.ht/~soywod/pimalaya/) library. ![image](https://user-images.githubusercontent.com/10437171/138774902-7b9de5a3-93eb-44b0-8cfb-6d2e11e3b1aa.png) @@ -25,19 +26,19 @@ production before the `v1.0.0`.* - JSON output - … -[Folder listing]: https://pimalaya.org/himalaya/docs/cli/usage/folders/list.html -[Envelopes listing]: https://pimalaya.org/himalaya/docs/cli/usage/envelopes/list.html -[searching]: https://pimalaya.org/himalaya/docs/cli/usage/envelopes/search.html -[sorting]: https://pimalaya.org/himalaya/docs/cli/usage/envelopes/sort.html -[Email composition]: https://pimalaya.org/himalaya/docs/cli/usage/emails/write.html -[copy]: https://pimalaya.org/himalaya/docs/cli/usage/emails/copy.html -[move]: https://pimalaya.org/himalaya/docs/cli/usage/emails/move.html -[delete]: https://pimalaya.org/himalaya/docs/cli/usage/emails/delete.html -[Multi-accounting]: https://pimalaya.org/himalaya/docs/cli/configuration.html -[Account listing]: https://pimalaya.org/himalaya/docs/cli/usage/accounts/list.html -[Account synchronization]: https://pimalaya.org/himalaya/docs/cli/usage/accounts/synchronize.html -[real-time notifications]: https://pimalaya.org/himalaya/docs/cli/usage/notifications.html -[Completions]: https://pimalaya.org/himalaya/docs/cli/tips/completion.html +[Folder listing]: https://pimalaya.org/himalaya/cli/usage/folders/list.html +[Envelopes listing]: https://pimalaya.org/himalaya/cli/usage/envelopes/list.html +[searching]: https://pimalaya.org/himalaya/cli/usage/envelopes/search.html +[sorting]: https://pimalaya.org/himalaya/cli/usage/envelopes/sort.html +[Email composition]: https://pimalaya.org/himalaya/cli/usage/emails/write.html +[copy]: https://pimalaya.org/himalaya/cli/usage/emails/copy.html +[move]: https://pimalaya.org/himalaya/cli/usage/emails/move.html +[delete]: https://pimalaya.org/himalaya/cli/usage/emails/delete.html +[Multi-accounting]: https://pimalaya.org/himalaya/cli/configuration.html +[Account listing]: https://pimalaya.org/himalaya/cli/usage/accounts/list.html +[Account synchronization]: https://pimalaya.org/himalaya/cli/usage/accounts/synchronize.html +[real-time notifications]: https://pimalaya.org/himalaya/cli/usage/notifications.html +[Completions]: https://pimalaya.org/himalaya/cli/tips/completion.html ## Installation @@ -71,7 +72,7 @@ $ nix-env -i himalaya ``` *See the -[documentation](https://pimalaya.org/himalaya/docs/cli/installation.html) +[documentation](https://pimalaya.org/himalaya/cli/installation.html) for other installation methods.* @@ -81,11 +82,12 @@ for other installation methods.* ## Configuration Please read the -[documentation](https://pimalaya.org/himalaya/docs/cli/configuration.html). +[documentation](https://pimalaya.org/himalaya/cli/configuration.html). ## Contributing -If you find a **bug**, please send an email at +If you find a **bug** that [does not exist +yet](https://todo.sr.ht/~soywod/pimalaya), please send an email at [~soywod/pimalaya@todo.sr.ht](mailto:~soywod/pimalaya@todo.sr.ht). If you have a **question**, please send an email at diff --git a/src/config/config.rs b/src/config/config.rs index ccc23cf..caeded6 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -5,8 +5,8 @@ use anyhow::{anyhow, Context, Result}; use dirs::{config_dir, home_dir}; -use himalaya_lib::{AccountConfig, BackendConfig, EmailHooks, EmailTextPlainFormat}; use log::{debug, trace}; +use pimalaya_email::{AccountConfig, BackendConfig, EmailHooks, EmailTextPlainFormat}; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, fs, path::PathBuf}; use toml; @@ -119,12 +119,12 @@ impl DeserializedConfig { #[cfg(test)] mod tests { - use himalaya_lib::{EmailSender, MaildirConfig, SendmailConfig, SmtpConfig}; + use pimalaya_email::{EmailSender, MaildirConfig, SendmailConfig, SmtpConfig}; #[cfg(feature = "imap-backend")] - use himalaya_lib::ImapConfig; + use pimalaya_email::ImapConfig; #[cfg(feature = "notmuch-backend")] - use himalaya_lib::NotmuchConfig; + use pimalaya_email::NotmuchConfig; use std::io::Write; use tempfile::NamedTempFile; diff --git a/src/config/prelude.rs b/src/config/prelude.rs index 82f5528..d121f28 100644 --- a/src/config/prelude.rs +++ b/src/config/prelude.rs @@ -1,4 +1,4 @@ -use himalaya_lib::{ +use pimalaya_email::{ folder::sync::Strategy as SyncFoldersStrategy, EmailHooks, EmailSender, EmailTextPlainFormat, MaildirConfig, SendmailConfig, SmtpConfig, }; @@ -6,10 +6,10 @@ use serde::{Deserialize, Serialize}; use std::{collections::HashSet, path::PathBuf}; #[cfg(feature = "imap-backend")] -use himalaya_lib::ImapConfig; +use pimalaya_email::ImapConfig; #[cfg(feature = "notmuch-backend")] -use himalaya_lib::NotmuchConfig; +use pimalaya_email::NotmuchConfig; #[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)] #[serde(remote = "SmtpConfig")] diff --git a/src/config/wizard/imap.rs b/src/config/wizard/imap.rs index 74d93eb..33f4b8e 100644 --- a/src/config/wizard/imap.rs +++ b/src/config/wizard/imap.rs @@ -4,7 +4,7 @@ use crate::account::{ }; use anyhow::Result; use dialoguer::{Input, Select}; -use himalaya_lib::ImapConfig; +use pimalaya_email::ImapConfig; #[cfg(feature = "imap-backend")] pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result { diff --git a/src/config/wizard/maildir.rs b/src/config/wizard/maildir.rs index 2670301..037deb2 100644 --- a/src/config/wizard/maildir.rs +++ b/src/config/wizard/maildir.rs @@ -5,7 +5,7 @@ use crate::account::{ use anyhow::Result; use dialoguer::Input; use dirs::home_dir; -use himalaya_lib::MaildirConfig; +use pimalaya_email::MaildirConfig; pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result { let input = if let Some(home) = home_dir() { diff --git a/src/config/wizard/notmuch.rs b/src/config/wizard/notmuch.rs index 15a78b1..df9cc6f 100644 --- a/src/config/wizard/notmuch.rs +++ b/src/config/wizard/notmuch.rs @@ -4,7 +4,7 @@ use crate::account::{ }; use anyhow::Result; use dialoguer::Input; -use himalaya_lib::{NotmuchBackend, NotmuchConfig}; +use pimalaya_email::{NotmuchBackend, NotmuchConfig}; pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result { let db_path = match NotmuchBackend::get_default_db_path() { diff --git a/src/config/wizard/sendmail.rs b/src/config/wizard/sendmail.rs index 82ae1a6..734fe69 100644 --- a/src/config/wizard/sendmail.rs +++ b/src/config/wizard/sendmail.rs @@ -1,7 +1,7 @@ use super::THEME; use anyhow::Result; use dialoguer::Input; -use himalaya_lib::{EmailSender, SendmailConfig}; +use pimalaya_email::{EmailSender, SendmailConfig}; pub(crate) fn configure() -> Result { Ok(EmailSender::Sendmail(SendmailConfig { diff --git a/src/config/wizard/smtp.rs b/src/config/wizard/smtp.rs index 3d0359d..197973f 100644 --- a/src/config/wizard/smtp.rs +++ b/src/config/wizard/smtp.rs @@ -2,7 +2,7 @@ use super::{SECURITY_PROTOCOLS, THEME}; use crate::account::DeserializedBaseAccountConfig; use anyhow::Result; use dialoguer::{Input, Select}; -use himalaya_lib::{EmailSender, SmtpConfig}; +use pimalaya_email::{EmailSender, SmtpConfig}; pub(crate) fn configure(base: &DeserializedBaseAccountConfig) -> Result { let mut smtp_config = SmtpConfig { diff --git a/src/domain/account/args.rs b/src/domain/account/args.rs index 7449f74..02233da 100644 --- a/src/domain/account/args.rs +++ b/src/domain/account/args.rs @@ -2,8 +2,8 @@ use anyhow::Result; use clap::{Arg, ArgAction, ArgMatches, Command}; -use himalaya_lib::folder::sync::Strategy as SyncFoldersStrategy; use log::info; +use pimalaya_email::folder::sync::Strategy as SyncFoldersStrategy; use std::collections::HashSet; use crate::{folder, ui::table}; diff --git a/src/domain/account/config.rs b/src/domain/account/config.rs index 6086dbb..4fd3d01 100644 --- a/src/domain/account/config.rs +++ b/src/domain/account/config.rs @@ -3,7 +3,7 @@ //! This module contains the raw deserialized representation of an //! account in the accounts section of the user configuration file. -use himalaya_lib::{ +use pimalaya_email::{ folder::sync::Strategy as SyncFoldersStrategy, AccountConfig, BackendConfig, EmailHooks, EmailSender, EmailTextPlainFormat, MaildirConfig, }; @@ -11,10 +11,10 @@ use serde::{Deserialize, Serialize}; use std::{collections::HashMap, path::PathBuf}; #[cfg(feature = "imap-backend")] -use himalaya_lib::ImapConfig; +use pimalaya_email::ImapConfig; #[cfg(feature = "notmuch-backend")] -use himalaya_lib::NotmuchConfig; +use pimalaya_email::NotmuchConfig; use crate::config::{prelude::*, DeserializedConfig}; diff --git a/src/domain/account/handlers.rs b/src/domain/account/handlers.rs index 442ad04..a0e4e33 100644 --- a/src/domain/account/handlers.rs +++ b/src/domain/account/handlers.rs @@ -3,12 +3,12 @@ //! This module gathers all account actions triggered by the CLI. use anyhow::Result; -use himalaya_lib::{ +use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; +use log::{info, trace}; +use pimalaya_email::{ folder::sync::Strategy as SyncFoldersStrategy, AccountConfig, Backend, BackendSyncBuilder, BackendSyncProgressEvent, }; -use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; -use log::{info, trace}; use crate::{ config::DeserializedConfig, @@ -226,7 +226,7 @@ pub fn sync( #[cfg(test)] mod tests { - use himalaya_lib::{AccountConfig, ImapConfig}; + use pimalaya_email::{AccountConfig, ImapConfig}; use std::{collections::HashMap, fmt::Debug, io}; use termcolor::ColorSpec; diff --git a/src/domain/email/handlers.rs b/src/domain/email/handlers.rs index 20b1d2c..6ddca41 100644 --- a/src/domain/email/handlers.rs +++ b/src/domain/email/handlers.rs @@ -1,9 +1,9 @@ use anyhow::{anyhow, Context, Result}; use atty::Stream; -use himalaya_lib::{ +use log::{debug, trace}; +use pimalaya_email::{ AccountConfig, Backend, Email, Flag, Flags, Sender, ShowTextPartsStrategy, Tpl, TplBuilder, }; -use log::{debug, trace}; use std::{ fs, io::{self, BufRead}, diff --git a/src/domain/envelope/envelope.rs b/src/domain/envelope/envelope.rs index 5c24133..d58c499 100644 --- a/src/domain/envelope/envelope.rs +++ b/src/domain/envelope/envelope.rs @@ -26,8 +26,8 @@ pub struct Envelope { pub date: DateTime, } -impl From<&himalaya_lib::Envelope> for Envelope { - fn from(envelope: &himalaya_lib::Envelope) -> Self { +impl From<&pimalaya_email::Envelope> for Envelope { + fn from(envelope: &pimalaya_email::Envelope) -> Self { Envelope { id: envelope.id.clone(), flags: envelope.flags.clone().into(), diff --git a/src/domain/envelope/envelopes.rs b/src/domain/envelope/envelopes.rs index 1842e8b..3efe2d3 100644 --- a/src/domain/envelope/envelopes.rs +++ b/src/domain/envelope/envelopes.rs @@ -21,8 +21,8 @@ impl ops::Deref for Envelopes { } } -impl From for Envelopes { - fn from(envelopes: himalaya_lib::Envelopes) -> Self { +impl From for Envelopes { + fn from(envelopes: pimalaya_email::Envelopes) -> Self { Envelopes(envelopes.iter().map(Envelope::from).collect()) } } diff --git a/src/domain/flag/args.rs b/src/domain/flag/args.rs index 5a660a0..32fe191 100644 --- a/src/domain/flag/args.rs +++ b/src/domain/flag/args.rs @@ -5,8 +5,8 @@ use anyhow::Result; use clap::{Arg, ArgMatches, Command}; -use himalaya_lib::{Flag, Flags}; use log::{debug, info}; +use pimalaya_email::{Flag, Flags}; use crate::email; diff --git a/src/domain/flag/flag.rs b/src/domain/flag/flag.rs index d9f2832..daea47c 100644 --- a/src/domain/flag/flag.rs +++ b/src/domain/flag/flag.rs @@ -11,15 +11,15 @@ pub enum Flag { Custom(String), } -impl From<&himalaya_lib::Flag> for Flag { - fn from(flag: &himalaya_lib::Flag) -> Self { +impl From<&pimalaya_email::Flag> for Flag { + fn from(flag: &pimalaya_email::Flag) -> Self { match flag { - himalaya_lib::Flag::Seen => Flag::Seen, - himalaya_lib::Flag::Answered => Flag::Answered, - himalaya_lib::Flag::Flagged => Flag::Flagged, - himalaya_lib::Flag::Deleted => Flag::Deleted, - himalaya_lib::Flag::Draft => Flag::Draft, - himalaya_lib::Flag::Custom(flag) => Flag::Custom(flag.clone()), + pimalaya_email::Flag::Seen => Flag::Seen, + pimalaya_email::Flag::Answered => Flag::Answered, + pimalaya_email::Flag::Flagged => Flag::Flagged, + pimalaya_email::Flag::Deleted => Flag::Deleted, + pimalaya_email::Flag::Draft => Flag::Draft, + pimalaya_email::Flag::Custom(flag) => Flag::Custom(flag.clone()), } } } diff --git a/src/domain/flag/flags.rs b/src/domain/flag/flags.rs index b413526..534cb97 100644 --- a/src/domain/flag/flags.rs +++ b/src/domain/flag/flags.rs @@ -14,8 +14,8 @@ impl ops::Deref for Flags { } } -impl From for Flags { - fn from(flags: himalaya_lib::Flags) -> Self { +impl From for Flags { + fn from(flags: pimalaya_email::Flags) -> Self { Flags(flags.iter().map(Flag::from).collect()) } } diff --git a/src/domain/flag/handlers.rs b/src/domain/flag/handlers.rs index 1f3eb66..0e184f7 100644 --- a/src/domain/flag/handlers.rs +++ b/src/domain/flag/handlers.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use himalaya_lib::{Backend, Flags}; +use pimalaya_email::{Backend, Flags}; use crate::printer::Printer; diff --git a/src/domain/folder/folder.rs b/src/domain/folder/folder.rs index 8e201d2..0aebace 100644 --- a/src/domain/folder/folder.rs +++ b/src/domain/folder/folder.rs @@ -9,8 +9,8 @@ pub struct Folder { pub desc: String, } -impl From<&himalaya_lib::Folder> for Folder { - fn from(folder: &himalaya_lib::Folder) -> Self { +impl From<&pimalaya_email::Folder> for Folder { + fn from(folder: &pimalaya_email::Folder) -> Self { Folder { delim: folder.delim.clone(), name: folder.name.clone(), diff --git a/src/domain/folder/folders.rs b/src/domain/folder/folders.rs index 93426d8..d3335ae 100644 --- a/src/domain/folder/folders.rs +++ b/src/domain/folder/folders.rs @@ -20,8 +20,8 @@ impl ops::Deref for Folders { } } -impl From for Folders { - fn from(folders: himalaya_lib::Folders) -> Self { +impl From for Folders { + fn from(folders: pimalaya_email::Folders) -> Self { Folders(folders.iter().map(Folder::from).collect()) } } diff --git a/src/domain/folder/handlers.rs b/src/domain/folder/handlers.rs index dc7b7f4..2e2a384 100644 --- a/src/domain/folder/handlers.rs +++ b/src/domain/folder/handlers.rs @@ -4,7 +4,7 @@ use anyhow::Result; use dialoguer::Confirm; -use himalaya_lib::{AccountConfig, Backend}; +use pimalaya_email::{AccountConfig, Backend}; use std::process; use crate::{ @@ -67,7 +67,7 @@ pub fn delete( #[cfg(test)] mod tests { - use himalaya_lib::{ + use pimalaya_email::{ backend, AccountConfig, Backend, Emails, Envelope, Envelopes, Flags, Folder, Folders, }; use std::{any::Any, fmt::Debug, io}; diff --git a/src/domain/imap/handlers.rs b/src/domain/imap/handlers.rs index 3302700..d664d30 100644 --- a/src/domain/imap/handlers.rs +++ b/src/domain/imap/handlers.rs @@ -3,7 +3,7 @@ //! This module gathers all IMAP handlers triggered by the CLI. use anyhow::{Context, Result}; -use himalaya_lib::ImapBackend; +use pimalaya_email::ImapBackend; pub fn notify(imap: &ImapBackend, folder: &str, keepalive: u64) -> Result<()> { imap.notify(keepalive, folder).context("cannot imap notify") diff --git a/src/domain/tpl/handlers.rs b/src/domain/tpl/handlers.rs index 51920e2..9f09b3b 100644 --- a/src/domain/tpl/handlers.rs +++ b/src/domain/tpl/handlers.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Result}; use atty::Stream; -use himalaya_lib::{AccountConfig, Backend, CompilerBuilder, Email, Flags, Sender, Tpl}; +use pimalaya_email::{AccountConfig, Backend, CompilerBuilder, Email, Flags, Sender, Tpl}; use std::io::{stdin, BufRead}; use crate::printer::Printer; diff --git a/src/main.rs b/src/main.rs index bfd2ac4..37669fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ use himalaya::{ printer::StdoutPrinter, tpl, }; -use himalaya_lib::{ +use pimalaya_email::{ BackendBuilder, BackendConfig, ImapBackend, SenderBuilder, DEFAULT_INBOX_FOLDER, }; diff --git a/src/printer/print.rs b/src/printer/print.rs index 7f03a5f..680fb11 100644 --- a/src/printer/print.rs +++ b/src/printer/print.rs @@ -1,5 +1,5 @@ use anyhow::{Context, Result}; -use himalaya_lib::Tpl; +use pimalaya_email::Tpl; use crate::printer::WriteColor; diff --git a/src/printer/print_table.rs b/src/printer/print_table.rs index bf6d75f..a2f847a 100644 --- a/src/printer/print_table.rs +++ b/src/printer/print_table.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use himalaya_lib::EmailTextPlainFormat; +use pimalaya_email::EmailTextPlainFormat; use std::io; use termcolor::{self, StandardStream}; diff --git a/src/ui/editor.rs b/src/ui/editor.rs index 3ef83d5..87ca7b1 100644 --- a/src/ui/editor.rs +++ b/src/ui/editor.rs @@ -1,9 +1,9 @@ use anyhow::{Context, Result}; -use himalaya_lib::{ +use log::debug; +use pimalaya_email::{ email::{local_draft_path, remove_local_draft}, AccountConfig, Backend, CompilerBuilder, Flag, Flags, Sender, Tpl, }; -use log::debug; use std::{env, fs, process::Command}; use crate::{ diff --git a/src/ui/table/table.rs b/src/ui/table/table.rs index de2dbde..4c43540 100644 --- a/src/ui/table/table.rs +++ b/src/ui/table/table.rs @@ -5,8 +5,8 @@ //! [builder design pattern]: https://refactoring.guru/design-patterns/builder use anyhow::{Context, Result}; -use himalaya_lib::EmailTextPlainFormat; use log::trace; +use pimalaya_email::EmailTextPlainFormat; use termcolor::{Color, ColorSpec}; use terminal_size; use unicode_width::UnicodeWidthStr;