diff --git a/pom.xml b/pom.xml
index b4491c5..781b8ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
dev.struchkov.godfather
telegram-bot
- 0.0.15
+ 0.0.17
pom
@@ -33,7 +33,7 @@
UTF-8
UTF-8
- 0.0.12
+ 0.0.14
6.1.0
3.10.1
diff --git a/telegram-core/pom.xml b/telegram-core/pom.xml
index 50d49e3..8a725ec 100644
--- a/telegram-core/pom.xml
+++ b/telegram-core/pom.xml
@@ -5,7 +5,7 @@
dev.struchkov.godfather
telegram-bot
- 0.0.15
+ 0.0.17
telegram-core
diff --git a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/convert/MessageMailConvert.java b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/convert/MessageMailConvert.java
index 05a74bd..36b9e6d 100644
--- a/telegram-core/src/main/java/dev/struchkov/godfather/telegram/convert/MessageMailConvert.java
+++ b/telegram-core/src/main/java/dev/struchkov/godfather/telegram/convert/MessageMailConvert.java
@@ -2,10 +2,15 @@ package dev.struchkov.godfather.telegram.convert;
import dev.struchkov.godfather.context.domain.content.Mail;
import dev.struchkov.godfather.context.domain.content.attachment.Attachment;
+import dev.struchkov.godfather.telegram.domain.attachment.ContactAttachment;
import dev.struchkov.godfather.telegram.domain.attachment.DocumentAttachment;
+import dev.struchkov.godfather.telegram.domain.attachment.Picture;
+import dev.struchkov.godfather.telegram.domain.attachment.PictureGroupAttachment;
+import org.telegram.telegrambots.meta.api.objects.Contact;
import org.telegram.telegrambots.meta.api.objects.Document;
import org.telegram.telegrambots.meta.api.objects.Message;
import org.telegram.telegrambots.meta.api.objects.MessageEntity;
+import org.telegram.telegrambots.meta.api.objects.PhotoSize;
import java.time.Instant;
import java.time.LocalDateTime;
@@ -38,6 +43,8 @@ public final class MessageMailConvert {
mail.setLastName(message.getChat().getLastName());
convertDocument(message.getDocument()).ifPresent(mail::addAttachment);
+ convertContact(message.getContact()).ifPresent(mail::addAttachment);
+ convertPhoto(message.getPhoto()).ifPresent(mail::addAttachment);
final List entities = message.getEntities();
if (entities != null) {
@@ -51,6 +58,46 @@ public final class MessageMailConvert {
return mail;
}
+ private static Optional convertPhoto(List photoSizes) {
+ if (photoSizes != null && !photoSizes.isEmpty()) {
+ final PictureGroupAttachment attachment = new PictureGroupAttachment();
+
+ final List