From e64f297579a6e98e16366200e62c61a6af6c88ec Mon Sep 17 00:00:00 2001 From: madhead Date: Wed, 28 Sep 2022 00:44:10 +0200 Subject: [PATCH] Allow previews for scheduled posts --- .../src/main/kotlin/by/jprof/telegram/bot/herald/impl/send.kt | 2 +- .../kotlin/by/jprof/telegram/bot/herald/model/Frontmatter.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/herald/src/main/kotlin/by/jprof/telegram/bot/herald/impl/send.kt b/herald/src/main/kotlin/by/jprof/telegram/bot/herald/impl/send.kt index 4349f05a..37f31fcb 100644 --- a/herald/src/main/kotlin/by/jprof/telegram/bot/herald/impl/send.kt +++ b/herald/src/main/kotlin/by/jprof/telegram/bot/herald/impl/send.kt @@ -48,7 +48,7 @@ suspend fun send(post: Post) { text = post.content.forChat(chat), parseMode = MarkdownV2ParseMode, replyMarkup = votes?.toInlineKeyboardMarkup(), - disableWebPagePreview = true, + disableWebPagePreview = post.frontmatter.disableWebPagePreview, ) } } diff --git a/herald/src/main/kotlin/by/jprof/telegram/bot/herald/model/Frontmatter.kt b/herald/src/main/kotlin/by/jprof/telegram/bot/herald/model/Frontmatter.kt index 6b90629c..6c500f10 100644 --- a/herald/src/main/kotlin/by/jprof/telegram/bot/herald/model/Frontmatter.kt +++ b/herald/src/main/kotlin/by/jprof/telegram/bot/herald/model/Frontmatter.kt @@ -7,4 +7,5 @@ data class Frontmatter( val chats: List, val image: String? = null, val votes: List? = null, + val disableWebPagePreview: Boolean = true, )