refactor: remove composer and reader

Composers and readers did not work as expected. It is just not possible for
himalaya to spawn a command that spawns $EDITOR, piping and redirection cannot
satisfy all the needs. Either the $EDITOR does not spawn (hangs over), either
himalaya does not collect any output from edition. The simplest way is to use an
intermediate temp file, or use process substitution. For eg., using mml:

  mml compose >(himalaya message send)

You can also write into a file then feed himalaya with it.
This commit is contained in:
Clément DOUIN
2026-06-01 15:19:45 +02:00
parent 3a1a981b8c
commit 662bd26eb1
151 changed files with 864 additions and 1291 deletions
+11 -5
View File
@@ -19,6 +19,7 @@ use anyhow::Result;
use clap::Subcommand;
use pimalaya_cli::printer::Printer;
use crate::account::context::Account;
use crate::imap::{
client::ImapClient,
envelope::{
@@ -43,12 +44,17 @@ pub enum ImapEnvelopeCommand {
}
impl ImapEnvelopeCommand {
pub fn execute(self, printer: &mut impl Printer, client: ImapClient) -> Result<()> {
pub fn execute(
self,
printer: &mut impl Printer,
account: &mut Account,
client: &mut ImapClient,
) -> Result<()> {
match self {
Self::Get(cmd) => cmd.execute(printer, client),
Self::List(cmd) => cmd.execute(printer, client),
Self::Search(cmd) => cmd.execute(printer, client),
Self::Sort(cmd) => cmd.execute(printer, client),
Self::Get(cmd) => cmd.execute(printer, account, client),
Self::List(cmd) => cmd.execute(printer, account, client),
Self::Search(cmd) => cmd.execute(printer, account, client),
Self::Sort(cmd) => cmd.execute(printer, account, client),
Self::Thread(cmd) => cmd.execute(printer, client),
}
}