mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
Add Params::get_file(), ::get_path() and ::get_blob()
Turns out that anyone that uses these either justs wants a file or wants a blob. Consolidate those patterns into one place and simplify all the callers.
This commit is contained in:
committed by
holger krekel
parent
6c9e16d31a
commit
5d79690260
@@ -1228,14 +1228,8 @@ unsafe fn create_or_lookup_group(
|
||||
if part.typ == Viewtype::Image {
|
||||
grpimage = part
|
||||
.param
|
||||
.get(Param::File)
|
||||
.and_then(|param| ParamsFile::from_param(context, param).ok())
|
||||
.and_then(|file| match file {
|
||||
ParamsFile::FsPath(path) => {
|
||||
BlobObject::create_from_path(context, path).ok()
|
||||
}
|
||||
ParamsFile::Blob(blob) => Some(blob),
|
||||
});
|
||||
.get_blob(Param::File, context, true)
|
||||
.unwrap_or(None);
|
||||
info!(context, "found image {:?}", grpimage);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user