complete preparations for files uploading via posts

This commit is contained in:
2022-03-09 18:46:08 +06:00
parent 99b953635e
commit 38cd186e60
7 changed files with 81 additions and 12 deletions

View File

@@ -22,8 +22,7 @@ class PublicationTargetTelegram(
) : PublicationTarget {
override suspend fun publish(post: PublicationPost) {
post.content.mapNotNull {
val content = it.content
when (content) {
when (val content = it.content) {
is BinaryContent -> {
val storageFile by lazy {
StorageFile(content.filename.name, content.inputProvider().readBytes()).asMultipartFile()