mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
introduce DC_EVENT_NEW_BLOB_FILE event and test for it
This commit is contained in:
@@ -208,7 +208,9 @@ impl Context {
|
||||
.open(&path)
|
||||
{
|
||||
file.write_all(data)?;
|
||||
return Ok(format!("$BLOBDIR/{}", candidate_basename));
|
||||
let db_entry = format!("$BLOBDIR/{}", candidate_basename);
|
||||
self.call_cb(Event::NewBlobFile(db_entry.clone()));
|
||||
return Ok(db_entry);
|
||||
}
|
||||
}
|
||||
bail!("out of luck to create new blob file");
|
||||
|
||||
@@ -54,6 +54,12 @@ pub enum Event {
|
||||
#[strum(props(id = "105"))]
|
||||
ImapMessageMoved(String),
|
||||
|
||||
/// Emitted when an new file in the $BLOBDIR was created
|
||||
///
|
||||
/// @return 0
|
||||
#[strum(props(id = "150"))]
|
||||
NewBlobFile(String),
|
||||
|
||||
/// The library-user should write a warning string to the log.
|
||||
/// Passed to the callback given to dc_context_new().
|
||||
///
|
||||
|
||||
@@ -947,7 +947,6 @@ fn add_smtp_job(context: &Context, action: Action, mimefactory: &MimeFactory) ->
|
||||
)
|
||||
};
|
||||
let bpath = context.new_blob_file(&mimefactory.rfc724_mid, bytes)?;
|
||||
info!(context, "add_smtp_job file written: {:?}", bpath);
|
||||
let recipients = mimefactory.recipients_addr.join("\x1e");
|
||||
param.set(Param::File, &bpath);
|
||||
param.set(Param::Recipients, &recipients);
|
||||
|
||||
Reference in New Issue
Block a user