From 35556762f02449d27c208391b79c22dfe6cb63a6 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Mon, 27 Nov 2023 15:49:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D1=83?= =?UTF-8?q?=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telegram/main/context/convert/MessageMailConvert.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/convert/MessageMailConvert.java b/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/convert/MessageMailConvert.java index 2ead488..3aa215a 100644 --- a/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/convert/MessageMailConvert.java +++ b/telegram-context/telegram-context-main/src/main/java/dev/struchkov/godfather/telegram/main/context/convert/MessageMailConvert.java @@ -15,6 +15,7 @@ import dev.struchkov.godfather.telegram.domain.attachment.VoiceAttachment; import dev.struchkov.godfather.telegram.main.context.MailPayload; import dev.struchkov.haiti.utils.Checker; import dev.struchkov.haiti.utils.Strings; +import org.glassfish.grizzly.http.util.MimeType; import org.telegram.telegrambots.meta.api.objects.Chat; import org.telegram.telegrambots.meta.api.objects.Contact; import org.telegram.telegrambots.meta.api.objects.Document; @@ -109,6 +110,8 @@ public final class MessageMailConvert { picture.setFileId(photoSize.getFileId()); picture.setHeight(photoSize.getHeight()); picture.setWeight(photoSize.getWidth()); + picture.setMimeType("image/jpeg"); + picture.setFileName(generateFileName("image/jpeg")); return picture; }).toList(); @@ -181,7 +184,7 @@ public final class MessageMailConvert { switch (mimeType) { case "audio/ogg" -> builder.append(".ogg"); case "image/png" -> builder.append(".png"); - case "image/jpeg" -> builder.append(".jpeg"); + case "image/jpeg" -> builder.append(".jpg"); default -> {} } return builder.toString();