mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 08:16:32 +03:00
Pass avatar file path to build_selfavatar_file as &str
This commit is contained in:
@@ -880,7 +880,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
|||||||
|
|
||||||
if self.attach_selfavatar {
|
if self.attach_selfavatar {
|
||||||
match context.get_config(Config::Selfavatar) {
|
match context.get_config(Config::Selfavatar) {
|
||||||
Some(path) => match build_selfavatar_file(context, path) {
|
Some(path) => match build_selfavatar_file(context, &path) {
|
||||||
Ok((part, filename)) => {
|
Ok((part, filename)) => {
|
||||||
parts.push(part);
|
parts.push(part);
|
||||||
protected_headers.push(Header::new("Chat-User-Avatar".into(), filename))
|
protected_headers.push(Header::new("Chat-User-Avatar".into(), filename))
|
||||||
@@ -1075,7 +1075,7 @@ fn build_body_file(
|
|||||||
Ok((mail, filename_to_send))
|
Ok((mail, filename_to_send))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_selfavatar_file(context: &Context, path: String) -> Result<(PartBuilder, String), Error> {
|
fn build_selfavatar_file(context: &Context, path: &str) -> Result<(PartBuilder, String), Error> {
|
||||||
let blob = BlobObject::from_path(context, path)?;
|
let blob = BlobObject::from_path(context, path)?;
|
||||||
let filename_to_send = match blob.suffix() {
|
let filename_to_send = match blob.suffix() {
|
||||||
Some(suffix) => format!("avatar.{}", suffix),
|
Some(suffix) => format!("avatar.{}", suffix),
|
||||||
|
|||||||
Reference in New Issue
Block a user