From a9b2a0ce6d205a82a9b5df77470457b8117f3f91 Mon Sep 17 00:00:00 2001 From: Dag Date: Sun, 11 Aug 2024 01:19:08 +0200 Subject: [PATCH] fix(telegram): add note if content is omitted from preview page --- bridges/TelegramBridge.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bridges/TelegramBridge.php b/bridges/TelegramBridge.php index a3c910e8671..5a1dbe54d0d 100644 --- a/bridges/TelegramBridge.php +++ b/bridges/TelegramBridge.php @@ -70,8 +70,14 @@ private function processContent($messageDiv) { $message = ''; + $notSupported = $messageDiv->find('div.message_media_not_supported_wrap', 0); + if ($notSupported) { + // For unknown reasons, the telegram preview page omits the content of this post + $message = "RSS-Bridge was unable to find the content of this post.

" . $notSupported->innertext; + } + if ($messageDiv->find('div.tgme_widget_message_forwarded_from', 0)) { - $message = $messageDiv->find('div.tgme_widget_message_forwarded_from', 0)->innertext . '

'; + $message .= $messageDiv->find('div.tgme_widget_message_forwarded_from', 0)->innertext . '

'; } if ($messageDiv->find('a.tgme_widget_message_reply', 0)) {