From 1840a47772b4a0f88ed203ffd199ef209953df72 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Fri, 18 Apr 2025 04:41:12 +0300 Subject: [PATCH] adding forward title in post content --- post_parser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/post_parser.py b/post_parser.py index b181b35..de7b520 100644 --- a/post_parser.py +++ b/post_parser.py @@ -562,15 +562,16 @@ class PostParser: text = text.replace('\n', '
') # Replace newlines with
text = self._add_hyperlinks_to_raw_urls(text) if text: # Message text - content_body.append(f'
{text}

') + content_body.append(f'
') + if message.forward_origin: content_body.append(f"--------- FWD from {message.forward_origin.sender_chat.title} ---------") + content_body.append(f'{text}') + if message.forward_origin: content_body.append(f"--------- FWD END from {message.forward_origin.sender_chat.title} ---------") + content_body.append(f'

') if poll := getattr(message, "poll", None): # Poll message if poll_html := self._format_poll(poll): content_body.append(poll_html) - if getattr(message, "channel_chat_created", False): # Create service message for "channel created" - content_body.append('
Channel created
') - html_body = '\n'.join(content_body) html_body = self._sanitize_html(html_body) return html_body