context.replies.push_back(UIEvent{id: 0,event_type: UIEventType::StatusNotification(format!("Multipart attachments are not supported yet."))});
return;
},
ContentType::Unsupported{..}=>{
letattachment_type=u.mime_type();
eprintln!("attachment type {}",attachment_type);
letbinary=query_default_app(attachment_type);
eprintln!("{:?}, binary = {:?}",p,binary);
Command::new(binary.unwrap())
.arg(p.path())
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
.expect("Failed to start xdg_open");
letbinary=query_default_app(&attachment_type);
ifletOk(binary)=binary{
letmutp=create_temp_file(&decode(u),None);
Command::new(&binary)
.arg(p.path())
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
.expect(&format!("Failed to start {}",binary.display()));
}else{
context.replies.push_back(UIEvent{id: 0,event_type: UIEventType::StatusNotification(format!("Couldn't find a default application for type {}",attachment_type))});