replace himalaya-lib by pimalaya-email

This commit is contained in:
Clément DOUIN 2023-04-20 12:12:33 +02:00
parent 7b3a9e4cc7
commit 072f488d89
No known key found for this signature in database
GPG key ID: 353E4A18EE0FAB72
31 changed files with 128 additions and 124 deletions

View file

@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[sourcehut#60]. [sourcehut#60].
- Replaced reply all `-a` argument with `-A` because it conflicted - Replaced reply all `-a` argument with `-A` because it conflicted
with the global option `-a|--account`. with the global option `-a|--account`.
- Replaced `himalaya-lib` by `pimalaya-email`.
### Fixed ### Fixed
@ -58,7 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Changed the location of the - Changed the location of the
[documentation](https://pimalaya.org/himalaya/docs/). [documentation](https://pimalaya.org/himalaya/).
### Fixed ### Fixed

82
Cargo.lock generated
View file

@ -785,10 +785,10 @@ dependencies = [
"email_address", "email_address",
"env_logger", "env_logger",
"erased-serde", "erased-serde",
"himalaya-lib",
"indicatif", "indicatif",
"log", "log",
"once_cell", "once_cell",
"pimalaya-email",
"serde", "serde",
"serde_json", "serde_json",
"shellexpand", "shellexpand",
@ -801,45 +801,6 @@ dependencies = [
"uuid", "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]] [[package]]
name = "hostname" name = "hostname"
version = "0.3.1" version = "0.3.1"
@ -1225,7 +1186,8 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
[[package]] [[package]]
name = "mime-msg-builder" name = "mime-msg-builder"
version = "0.1.0" 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 = [ dependencies = [
"ammonia", "ammonia",
"chumsky 0.9.0", "chumsky 0.9.0",
@ -1544,6 +1506,44 @@ dependencies = [
"siphasher", "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]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.9" version = "0.2.9"

View file

@ -1,14 +1,14 @@
[package] [package]
name = "himalaya" name = "himalaya"
description = "Command-line interface for email management." description = "CLI to manage your emails."
version = "0.7.1" version = "0.7.1"
authors = ["soywod <clement.douin@posteo.net>"] authors = ["soywod <clement.douin@posteo.net>"]
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
categories = ["command-line-interface", "command-line-utilities", "email"] categories = ["command-line-interface", "command-line-utilities", "email"]
keywords = ["cli", "mail", "email", "client", "imap"] keywords = ["cli", "mail", "email", "client", "imap"]
homepage = "https://github.com/soywod/himalaya" homepage = "https://pimalaya.org/himalaya/"
documentation = "https://github.com/soywod/himalaya/wiki" documentation = "https://pimalaya.org/himalaya/"
repository = "https://github.com/soywod/himalaya" repository = "https://github.com/soywod/himalaya"
[package.metadata.deb] [package.metadata.deb]
@ -19,19 +19,19 @@ section = "mail"
default = ["imap-backend", "smtp-sender", "native-tls"] default = ["imap-backend", "smtp-sender", "native-tls"]
# backends # backends
imap-backend = ["himalaya-lib/imap-backend"] imap-backend = ["pimalaya-email/imap-backend"]
notmuch-backend = ["himalaya-lib/notmuch-backend"] notmuch-backend = ["pimalaya-email/notmuch-backend"]
# senders # senders
smtp-sender = ["himalaya-lib/smtp-sender"] smtp-sender = ["pimalaya-email/smtp-sender"]
# native tls # native tls
native-tls = ["himalaya-lib/native-tls"] native-tls = ["pimalaya-email/native-tls"]
native-tls-vendored = ["himalaya-lib/native-tls-vendored"] native-tls-vendored = ["pimalaya-email/native-tls-vendored"]
# rustls # rustls
rustls-tls = ["himalaya-lib/rustls-tls"] rustls-tls = ["pimalaya-email/rustls-tls"]
rustls-native-certs = ["himalaya-lib/rustls-native-certs"] rustls-native-certs = ["pimalaya-email/rustls-native-certs"]
[dev-dependencies] [dev-dependencies]
tempfile = "3.3" tempfile = "3.3"
@ -49,7 +49,8 @@ dialoguer = "0.10.2"
email_address = "0.2.4" email_address = "0.2.4"
env_logger = "0.8" env_logger = "0.8"
erased-serde = "0.3" 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" indicatif = "0.17"
log = "0.4" log = "0.4"
once_cell = "1.16.0" once_cell = "1.16.0"

View file

@ -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 [![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 https://pimalaya.org/himalaya/
[himalaya-lib](https://git.sr.ht/~soywod/himalaya-lib) that allows you
to manipulate your emails using commands in your console. 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) ![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 - JSON output
- … - …
[Folder listing]: https://pimalaya.org/himalaya/docs/cli/usage/folders/list.html [Folder listing]: https://pimalaya.org/himalaya/cli/usage/folders/list.html
[Envelopes listing]: https://pimalaya.org/himalaya/docs/cli/usage/envelopes/list.html [Envelopes listing]: https://pimalaya.org/himalaya/cli/usage/envelopes/list.html
[searching]: https://pimalaya.org/himalaya/docs/cli/usage/envelopes/search.html [searching]: https://pimalaya.org/himalaya/cli/usage/envelopes/search.html
[sorting]: https://pimalaya.org/himalaya/docs/cli/usage/envelopes/sort.html [sorting]: https://pimalaya.org/himalaya/cli/usage/envelopes/sort.html
[Email composition]: https://pimalaya.org/himalaya/docs/cli/usage/emails/write.html [Email composition]: https://pimalaya.org/himalaya/cli/usage/emails/write.html
[copy]: https://pimalaya.org/himalaya/docs/cli/usage/emails/copy.html [copy]: https://pimalaya.org/himalaya/cli/usage/emails/copy.html
[move]: https://pimalaya.org/himalaya/docs/cli/usage/emails/move.html [move]: https://pimalaya.org/himalaya/cli/usage/emails/move.html
[delete]: https://pimalaya.org/himalaya/docs/cli/usage/emails/delete.html [delete]: https://pimalaya.org/himalaya/cli/usage/emails/delete.html
[Multi-accounting]: https://pimalaya.org/himalaya/docs/cli/configuration.html [Multi-accounting]: https://pimalaya.org/himalaya/cli/configuration.html
[Account listing]: https://pimalaya.org/himalaya/docs/cli/usage/accounts/list.html [Account listing]: https://pimalaya.org/himalaya/cli/usage/accounts/list.html
[Account synchronization]: https://pimalaya.org/himalaya/docs/cli/usage/accounts/synchronize.html [Account synchronization]: https://pimalaya.org/himalaya/cli/usage/accounts/synchronize.html
[real-time notifications]: https://pimalaya.org/himalaya/docs/cli/usage/notifications.html [real-time notifications]: https://pimalaya.org/himalaya/cli/usage/notifications.html
[Completions]: https://pimalaya.org/himalaya/docs/cli/tips/completion.html [Completions]: https://pimalaya.org/himalaya/cli/tips/completion.html
## Installation ## Installation
@ -71,7 +72,7 @@ $ nix-env -i himalaya
``` ```
*See the *See the
[documentation](https://pimalaya.org/himalaya/docs/cli/installation.html) [documentation](https://pimalaya.org/himalaya/cli/installation.html)
for other installation methods.* for other installation methods.*
</td> </td>
@ -81,11 +82,12 @@ for other installation methods.*
## Configuration ## Configuration
Please read the Please read the
[documentation](https://pimalaya.org/himalaya/docs/cli/configuration.html). [documentation](https://pimalaya.org/himalaya/cli/configuration.html).
## Contributing ## 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). [~soywod/pimalaya@todo.sr.ht](mailto:~soywod/pimalaya@todo.sr.ht).
If you have a **question**, please send an email at If you have a **question**, please send an email at

View file

@ -5,8 +5,8 @@
use anyhow::{anyhow, Context, Result}; use anyhow::{anyhow, Context, Result};
use dirs::{config_dir, home_dir}; use dirs::{config_dir, home_dir};
use himalaya_lib::{AccountConfig, BackendConfig, EmailHooks, EmailTextPlainFormat};
use log::{debug, trace}; use log::{debug, trace};
use pimalaya_email::{AccountConfig, BackendConfig, EmailHooks, EmailTextPlainFormat};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{collections::HashMap, fs, path::PathBuf}; use std::{collections::HashMap, fs, path::PathBuf};
use toml; use toml;
@ -119,12 +119,12 @@ impl DeserializedConfig {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use himalaya_lib::{EmailSender, MaildirConfig, SendmailConfig, SmtpConfig}; use pimalaya_email::{EmailSender, MaildirConfig, SendmailConfig, SmtpConfig};
#[cfg(feature = "imap-backend")] #[cfg(feature = "imap-backend")]
use himalaya_lib::ImapConfig; use pimalaya_email::ImapConfig;
#[cfg(feature = "notmuch-backend")] #[cfg(feature = "notmuch-backend")]
use himalaya_lib::NotmuchConfig; use pimalaya_email::NotmuchConfig;
use std::io::Write; use std::io::Write;
use tempfile::NamedTempFile; use tempfile::NamedTempFile;

View file

@ -1,4 +1,4 @@
use himalaya_lib::{ use pimalaya_email::{
folder::sync::Strategy as SyncFoldersStrategy, EmailHooks, EmailSender, EmailTextPlainFormat, folder::sync::Strategy as SyncFoldersStrategy, EmailHooks, EmailSender, EmailTextPlainFormat,
MaildirConfig, SendmailConfig, SmtpConfig, MaildirConfig, SendmailConfig, SmtpConfig,
}; };
@ -6,10 +6,10 @@ use serde::{Deserialize, Serialize};
use std::{collections::HashSet, path::PathBuf}; use std::{collections::HashSet, path::PathBuf};
#[cfg(feature = "imap-backend")] #[cfg(feature = "imap-backend")]
use himalaya_lib::ImapConfig; use pimalaya_email::ImapConfig;
#[cfg(feature = "notmuch-backend")] #[cfg(feature = "notmuch-backend")]
use himalaya_lib::NotmuchConfig; use pimalaya_email::NotmuchConfig;
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
#[serde(remote = "SmtpConfig")] #[serde(remote = "SmtpConfig")]

View file

@ -4,7 +4,7 @@ use crate::account::{
}; };
use anyhow::Result; use anyhow::Result;
use dialoguer::{Input, Select}; use dialoguer::{Input, Select};
use himalaya_lib::ImapConfig; use pimalaya_email::ImapConfig;
#[cfg(feature = "imap-backend")] #[cfg(feature = "imap-backend")]
pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result<DeserializedAccountConfig> { pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result<DeserializedAccountConfig> {

View file

@ -5,7 +5,7 @@ use crate::account::{
use anyhow::Result; use anyhow::Result;
use dialoguer::Input; use dialoguer::Input;
use dirs::home_dir; use dirs::home_dir;
use himalaya_lib::MaildirConfig; use pimalaya_email::MaildirConfig;
pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result<DeserializedAccountConfig> { pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result<DeserializedAccountConfig> {
let input = if let Some(home) = home_dir() { let input = if let Some(home) = home_dir() {

View file

@ -4,7 +4,7 @@ use crate::account::{
}; };
use anyhow::Result; use anyhow::Result;
use dialoguer::Input; use dialoguer::Input;
use himalaya_lib::{NotmuchBackend, NotmuchConfig}; use pimalaya_email::{NotmuchBackend, NotmuchConfig};
pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result<DeserializedAccountConfig> { pub(crate) fn configure(base: DeserializedBaseAccountConfig) -> Result<DeserializedAccountConfig> {
let db_path = match NotmuchBackend::get_default_db_path() { let db_path = match NotmuchBackend::get_default_db_path() {

View file

@ -1,7 +1,7 @@
use super::THEME; use super::THEME;
use anyhow::Result; use anyhow::Result;
use dialoguer::Input; use dialoguer::Input;
use himalaya_lib::{EmailSender, SendmailConfig}; use pimalaya_email::{EmailSender, SendmailConfig};
pub(crate) fn configure() -> Result<EmailSender> { pub(crate) fn configure() -> Result<EmailSender> {
Ok(EmailSender::Sendmail(SendmailConfig { Ok(EmailSender::Sendmail(SendmailConfig {

View file

@ -2,7 +2,7 @@ use super::{SECURITY_PROTOCOLS, THEME};
use crate::account::DeserializedBaseAccountConfig; use crate::account::DeserializedBaseAccountConfig;
use anyhow::Result; use anyhow::Result;
use dialoguer::{Input, Select}; use dialoguer::{Input, Select};
use himalaya_lib::{EmailSender, SmtpConfig}; use pimalaya_email::{EmailSender, SmtpConfig};
pub(crate) fn configure(base: &DeserializedBaseAccountConfig) -> Result<EmailSender> { pub(crate) fn configure(base: &DeserializedBaseAccountConfig) -> Result<EmailSender> {
let mut smtp_config = SmtpConfig { let mut smtp_config = SmtpConfig {

View file

@ -2,8 +2,8 @@
use anyhow::Result; use anyhow::Result;
use clap::{Arg, ArgAction, ArgMatches, Command}; use clap::{Arg, ArgAction, ArgMatches, Command};
use himalaya_lib::folder::sync::Strategy as SyncFoldersStrategy;
use log::info; use log::info;
use pimalaya_email::folder::sync::Strategy as SyncFoldersStrategy;
use std::collections::HashSet; use std::collections::HashSet;
use crate::{folder, ui::table}; use crate::{folder, ui::table};

View file

@ -3,7 +3,7 @@
//! This module contains the raw deserialized representation of an //! This module contains the raw deserialized representation of an
//! account in the accounts section of the user configuration file. //! account in the accounts section of the user configuration file.
use himalaya_lib::{ use pimalaya_email::{
folder::sync::Strategy as SyncFoldersStrategy, AccountConfig, BackendConfig, EmailHooks, folder::sync::Strategy as SyncFoldersStrategy, AccountConfig, BackendConfig, EmailHooks,
EmailSender, EmailTextPlainFormat, MaildirConfig, EmailSender, EmailTextPlainFormat, MaildirConfig,
}; };
@ -11,10 +11,10 @@ use serde::{Deserialize, Serialize};
use std::{collections::HashMap, path::PathBuf}; use std::{collections::HashMap, path::PathBuf};
#[cfg(feature = "imap-backend")] #[cfg(feature = "imap-backend")]
use himalaya_lib::ImapConfig; use pimalaya_email::ImapConfig;
#[cfg(feature = "notmuch-backend")] #[cfg(feature = "notmuch-backend")]
use himalaya_lib::NotmuchConfig; use pimalaya_email::NotmuchConfig;
use crate::config::{prelude::*, DeserializedConfig}; use crate::config::{prelude::*, DeserializedConfig};

View file

@ -3,12 +3,12 @@
//! This module gathers all account actions triggered by the CLI. //! This module gathers all account actions triggered by the CLI.
use anyhow::Result; 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, folder::sync::Strategy as SyncFoldersStrategy, AccountConfig, Backend, BackendSyncBuilder,
BackendSyncProgressEvent, BackendSyncProgressEvent,
}; };
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
use log::{info, trace};
use crate::{ use crate::{
config::DeserializedConfig, config::DeserializedConfig,
@ -226,7 +226,7 @@ pub fn sync<P: Printer>(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use himalaya_lib::{AccountConfig, ImapConfig}; use pimalaya_email::{AccountConfig, ImapConfig};
use std::{collections::HashMap, fmt::Debug, io}; use std::{collections::HashMap, fmt::Debug, io};
use termcolor::ColorSpec; use termcolor::ColorSpec;

View file

@ -1,9 +1,9 @@
use anyhow::{anyhow, Context, Result}; use anyhow::{anyhow, Context, Result};
use atty::Stream; use atty::Stream;
use himalaya_lib::{ use log::{debug, trace};
use pimalaya_email::{
AccountConfig, Backend, Email, Flag, Flags, Sender, ShowTextPartsStrategy, Tpl, TplBuilder, AccountConfig, Backend, Email, Flag, Flags, Sender, ShowTextPartsStrategy, Tpl, TplBuilder,
}; };
use log::{debug, trace};
use std::{ use std::{
fs, fs,
io::{self, BufRead}, io::{self, BufRead},

View file

@ -26,8 +26,8 @@ pub struct Envelope {
pub date: DateTime<Local>, pub date: DateTime<Local>,
} }
impl From<&himalaya_lib::Envelope> for Envelope { impl From<&pimalaya_email::Envelope> for Envelope {
fn from(envelope: &himalaya_lib::Envelope) -> Self { fn from(envelope: &pimalaya_email::Envelope) -> Self {
Envelope { Envelope {
id: envelope.id.clone(), id: envelope.id.clone(),
flags: envelope.flags.clone().into(), flags: envelope.flags.clone().into(),

View file

@ -21,8 +21,8 @@ impl ops::Deref for Envelopes {
} }
} }
impl From<himalaya_lib::Envelopes> for Envelopes { impl From<pimalaya_email::Envelopes> for Envelopes {
fn from(envelopes: himalaya_lib::Envelopes) -> Self { fn from(envelopes: pimalaya_email::Envelopes) -> Self {
Envelopes(envelopes.iter().map(Envelope::from).collect()) Envelopes(envelopes.iter().map(Envelope::from).collect())
} }
} }

View file

@ -5,8 +5,8 @@
use anyhow::Result; use anyhow::Result;
use clap::{Arg, ArgMatches, Command}; use clap::{Arg, ArgMatches, Command};
use himalaya_lib::{Flag, Flags};
use log::{debug, info}; use log::{debug, info};
use pimalaya_email::{Flag, Flags};
use crate::email; use crate::email;

View file

@ -11,15 +11,15 @@ pub enum Flag {
Custom(String), Custom(String),
} }
impl From<&himalaya_lib::Flag> for Flag { impl From<&pimalaya_email::Flag> for Flag {
fn from(flag: &himalaya_lib::Flag) -> Self { fn from(flag: &pimalaya_email::Flag) -> Self {
match flag { match flag {
himalaya_lib::Flag::Seen => Flag::Seen, pimalaya_email::Flag::Seen => Flag::Seen,
himalaya_lib::Flag::Answered => Flag::Answered, pimalaya_email::Flag::Answered => Flag::Answered,
himalaya_lib::Flag::Flagged => Flag::Flagged, pimalaya_email::Flag::Flagged => Flag::Flagged,
himalaya_lib::Flag::Deleted => Flag::Deleted, pimalaya_email::Flag::Deleted => Flag::Deleted,
himalaya_lib::Flag::Draft => Flag::Draft, pimalaya_email::Flag::Draft => Flag::Draft,
himalaya_lib::Flag::Custom(flag) => Flag::Custom(flag.clone()), pimalaya_email::Flag::Custom(flag) => Flag::Custom(flag.clone()),
} }
} }
} }

View file

@ -14,8 +14,8 @@ impl ops::Deref for Flags {
} }
} }
impl From<himalaya_lib::Flags> for Flags { impl From<pimalaya_email::Flags> for Flags {
fn from(flags: himalaya_lib::Flags) -> Self { fn from(flags: pimalaya_email::Flags) -> Self {
Flags(flags.iter().map(Flag::from).collect()) Flags(flags.iter().map(Flag::from).collect())
} }
} }

View file

@ -1,5 +1,5 @@
use anyhow::Result; use anyhow::Result;
use himalaya_lib::{Backend, Flags}; use pimalaya_email::{Backend, Flags};
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -9,8 +9,8 @@ pub struct Folder {
pub desc: String, pub desc: String,
} }
impl From<&himalaya_lib::Folder> for Folder { impl From<&pimalaya_email::Folder> for Folder {
fn from(folder: &himalaya_lib::Folder) -> Self { fn from(folder: &pimalaya_email::Folder) -> Self {
Folder { Folder {
delim: folder.delim.clone(), delim: folder.delim.clone(),
name: folder.name.clone(), name: folder.name.clone(),

View file

@ -20,8 +20,8 @@ impl ops::Deref for Folders {
} }
} }
impl From<himalaya_lib::Folders> for Folders { impl From<pimalaya_email::Folders> for Folders {
fn from(folders: himalaya_lib::Folders) -> Self { fn from(folders: pimalaya_email::Folders) -> Self {
Folders(folders.iter().map(Folder::from).collect()) Folders(folders.iter().map(Folder::from).collect())
} }
} }

View file

@ -4,7 +4,7 @@
use anyhow::Result; use anyhow::Result;
use dialoguer::Confirm; use dialoguer::Confirm;
use himalaya_lib::{AccountConfig, Backend}; use pimalaya_email::{AccountConfig, Backend};
use std::process; use std::process;
use crate::{ use crate::{
@ -67,7 +67,7 @@ pub fn delete<P: Printer, B: Backend + ?Sized>(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use himalaya_lib::{ use pimalaya_email::{
backend, AccountConfig, Backend, Emails, Envelope, Envelopes, Flags, Folder, Folders, backend, AccountConfig, Backend, Emails, Envelope, Envelopes, Flags, Folder, Folders,
}; };
use std::{any::Any, fmt::Debug, io}; use std::{any::Any, fmt::Debug, io};

View file

@ -3,7 +3,7 @@
//! This module gathers all IMAP handlers triggered by the CLI. //! This module gathers all IMAP handlers triggered by the CLI.
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use himalaya_lib::ImapBackend; use pimalaya_email::ImapBackend;
pub fn notify(imap: &ImapBackend, folder: &str, keepalive: u64) -> Result<()> { pub fn notify(imap: &ImapBackend, folder: &str, keepalive: u64) -> Result<()> {
imap.notify(keepalive, folder).context("cannot imap notify") imap.notify(keepalive, folder).context("cannot imap notify")

View file

@ -1,6 +1,6 @@
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use atty::Stream; 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 std::io::{stdin, BufRead};
use crate::printer::Printer; use crate::printer::Printer;

View file

@ -10,7 +10,7 @@ use himalaya::{
printer::StdoutPrinter, printer::StdoutPrinter,
tpl, tpl,
}; };
use himalaya_lib::{ use pimalaya_email::{
BackendBuilder, BackendConfig, ImapBackend, SenderBuilder, DEFAULT_INBOX_FOLDER, BackendBuilder, BackendConfig, ImapBackend, SenderBuilder, DEFAULT_INBOX_FOLDER,
}; };

View file

@ -1,5 +1,5 @@
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use himalaya_lib::Tpl; use pimalaya_email::Tpl;
use crate::printer::WriteColor; use crate::printer::WriteColor;

View file

@ -1,5 +1,5 @@
use anyhow::Result; use anyhow::Result;
use himalaya_lib::EmailTextPlainFormat; use pimalaya_email::EmailTextPlainFormat;
use std::io; use std::io;
use termcolor::{self, StandardStream}; use termcolor::{self, StandardStream};

View file

@ -1,9 +1,9 @@
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use himalaya_lib::{ use log::debug;
use pimalaya_email::{
email::{local_draft_path, remove_local_draft}, email::{local_draft_path, remove_local_draft},
AccountConfig, Backend, CompilerBuilder, Flag, Flags, Sender, Tpl, AccountConfig, Backend, CompilerBuilder, Flag, Flags, Sender, Tpl,
}; };
use log::debug;
use std::{env, fs, process::Command}; use std::{env, fs, process::Command};
use crate::{ use crate::{

View file

@ -5,8 +5,8 @@
//! [builder design pattern]: https://refactoring.guru/design-patterns/builder //! [builder design pattern]: https://refactoring.guru/design-patterns/builder
use anyhow::{Context, Result}; use anyhow::{Context, Result};
use himalaya_lib::EmailTextPlainFormat;
use log::trace; use log::trace;
use pimalaya_email::EmailTextPlainFormat;
use termcolor::{Color, ColorSpec}; use termcolor::{Color, ColorSpec};
use terminal_size; use terminal_size;
use unicode_width::UnicodeWidthStr; use unicode_width::UnicodeWidthStr;