From 3aafd44079fccd09973fbd8ba75a128d0d150553 Mon Sep 17 00:00:00 2001 From: Andrea Draghetti Date: Tue, 16 Mar 2021 14:04:07 +0100 Subject: [PATCH] [TelegramBridge] Display the name of the attachments (#2003) Sometimes attachments are posted in Telegram channels without any text. The script recognizes a new message but does not report any text, with this commit the file names will also be included in the RSS Feed. --- bridges/TelegramBridge.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bridges/TelegramBridge.php b/bridges/TelegramBridge.php index 152e2da00ac..0004ce0a634 100644 --- a/bridges/TelegramBridge.php +++ b/bridges/TelegramBridge.php @@ -132,6 +132,12 @@ private function processContent($messageDiv) { $messageDiv->find('div.tgme_widget_message_text.js-message_text', 0)->plaintext ); } + if ($messageDiv->find('div.tgme_widget_message_document', 0)) { + $message .= 'Attachments:'; + foreach ($messageDiv->find('div.tgme_widget_message_document') as $attachments) { + $message .= $attachments->find('div.tgme_widget_message_document_title.accent_color', 0); + } + } if ($messageDiv->find('a.tgme_widget_message_link_preview', 0)) { $message .= $this->processLinkPreview($messageDiv);