Skip to content

Commit

Permalink
[TelegramBridge] Display the name of the attachments (#2003)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
drego85 authored Mar 16, 2021
1 parent 75b85f6 commit 3aafd44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bridges/TelegramBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3aafd44

Please sign in to comment.