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
server/src/main
java
dev
inmo
postssystem
server
resources
services/posts
client
src
commonMain
kotlin
dev
inmo
postssystem
services
common
src
commonMain
kotlin
dev
inmo
postssystem
server
src
jvmMain
kotlin
dev
inmo
postssystem
targets/telegram/publication/server/src/jvmMain/kotlin/dev/inmo/postssystem/targets/telegram/publication/server

@ -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()