aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2024-08-11 01:23:10 +0200
committerGravatar GitHub <noreply@github.com> 2024-08-11 01:23:10 +0200
commit133dbf87c50c70f8644cfd7916aff3daa8fac520 (patch)
treef94c259842d199b62a087dcc6a0c507275a605a8
parent2e6e2467598c8400cf476cb5914b3a8bd1a3601d (diff)
downloadrss-bridge-133dbf87c50c70f8644cfd7916aff3daa8fac520.tar.gz
rss-bridge-133dbf87c50c70f8644cfd7916aff3daa8fac520.tar.zst
rss-bridge-133dbf87c50c70f8644cfd7916aff3daa8fac520.zip
fix(telegram): add note if content is omitted from preview page (#4210)
* fix(telegram): add note if content is omitted from preview page * lint
-rw-r--r--bridges/TelegramBridge.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/bridges/TelegramBridge.php b/bridges/TelegramBridge.php
index a3c910e8..81c5aeb9 100644
--- a/bridges/TelegramBridge.php
+++ b/bridges/TelegramBridge.php
@@ -70,8 +70,14 @@ class TelegramBridge extends BridgeAbstract
{
$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.<br><br>' . $notSupported->innertext;
+ }
+
if ($messageDiv->find('div.tgme_widget_message_forwarded_from', 0)) {
- $message = $messageDiv->find('div.tgme_widget_message_forwarded_from', 0)->innertext . '<br><br>';
+ $message .= $messageDiv->find('div.tgme_widget_message_forwarded_from', 0)->innertext . '<br><br>';
}
if ($messageDiv->find('a.tgme_widget_message_reply', 0)) {