clean msg flags, merge tpl entity in msg (#231)

* merge tpl entity into msg

* change envelope subject type to cow

* msg: fix save command when raw msg comes from stdin

* msg: clean flags
This commit is contained in:
Clément DOUIN
2021-10-23 00:17:24 +02:00
committed by GitHub
parent 45aac9fbec
commit d9272917f5
19 changed files with 228 additions and 264 deletions
+5 -6
View File
@@ -2,9 +2,9 @@ use anyhow::{Context, Result};
use log::debug;
use std::{env, fs, process::Command};
use crate::domain::msg::{msg_utils, Tpl};
use crate::domain::msg::msg_utils;
pub fn open_with_tpl(tpl: Tpl) -> Result<Tpl> {
pub fn open_with_tpl(tpl: String) -> Result<String> {
let path = msg_utils::local_draft_path();
debug!("create draft");
@@ -20,13 +20,12 @@ pub fn open_with_tpl(tpl: Tpl) -> Result<Tpl> {
let content =
fs::read_to_string(&path).context(format!("cannot read local draft at {:?}", path))?;
Ok(Tpl(content))
Ok(content)
}
pub fn open_with_draft() -> Result<Tpl> {
pub fn open_with_draft() -> Result<String> {
let path = msg_utils::local_draft_path();
let content =
let tpl =
fs::read_to_string(&path).context(format!("cannot read local draft at {:?}", path))?;
let tpl = Tpl(content);
open_with_tpl(tpl)
}