mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
Download & decrypt uploaded attachements.
- Parse the "Chat-Upload-Url" header - Add message::schedule_download function to schedule download job - In the job download, decrypt, save
This commit is contained in:
@@ -371,6 +371,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
||||
listmsgs <query>\n\
|
||||
msginfo <msg-id>\n\
|
||||
openfile <msg-id>\n\
|
||||
download <msg-id>\n\
|
||||
listfresh\n\
|
||||
forward <msg-id> <chat-id>\n\
|
||||
markseen <msg-id>\n\
|
||||
@@ -900,6 +901,16 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
|
||||
let filepath = filepath.unwrap();
|
||||
open::that(filepath)?;
|
||||
}
|
||||
"download" => {
|
||||
ensure!(!arg1.is_empty(), "Argument <msg-id> missing.");
|
||||
let id = MsgId::new(arg1.parse()?);
|
||||
let path = if !arg2.is_empty() {
|
||||
Some(arg2.into())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
message::schedule_download(&context, id, path).await?;
|
||||
}
|
||||
"listfresh" => {
|
||||
let msglist = context.get_fresh_msgs().await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user