From a13e1f1f10cbbca7a832f0db9c38395b469e46f8 Mon Sep 17 00:00:00 2001 From: Manuel cortez Date: Fri, 7 Nov 2025 09:08:39 -0600 Subject: [PATCH] Added support for reading quoted posts properly --- src/sessions/mastodon/compose.py | 5 +++++ src/sessions/mastodon/templates.py | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/sessions/mastodon/compose.py b/src/sessions/mastodon/compose.py index d95cc6c4..b9d9534f 100644 --- a/src/sessions/mastodon/compose.py +++ b/src/sessions/mastodon/compose.py @@ -17,6 +17,11 @@ def compose_post(post, db, settings, relative_times, show_screen_names, safe=Tru text = _("Boosted from @{}: {}").format(post.reblog.account.acct, templates.process_text(post.reblog, safe=safe)) else: text = templates.process_text(post, safe=safe) + # Handle quoted posts + if hasattr(post, 'quote') and post.quote != None and hasattr(post.quote, 'quoted_status') and post.quote.quoted_status != None: + quoted_user = post.quote.quoted_status.account.acct + quoted_text = templates.process_text(post.quote.quoted_status, safe=safe) + text = text + " " + _("Quoting @{}: {}").format(quoted_user, quoted_text) filtered = utils.evaluate_filters(post=post, current_context="home") if filtered != None: text = _("hidden by filter {}").format(filtered) diff --git a/src/sessions/mastodon/templates.py b/src/sessions/mastodon/templates.py index 0c0083f6..2674bea3 100644 --- a/src/sessions/mastodon/templates.py +++ b/src/sessions/mastodon/templates.py @@ -76,6 +76,13 @@ def render_post(post, template, settings, relative_times=False, offset_hours=0): else: text = process_text(post, safe=False) safe_text = process_text(post) + # Handle quoted posts + if hasattr(post, 'quote') and post.quote != None and hasattr(post.quote, 'quoted_status') and post.quote.quoted_status != None: + quoted_user = post.quote.quoted_status.account.acct + quoted_text = process_text(post.quote.quoted_status, safe=False) + quoted_safe_text = process_text(post.quote.quoted_status, safe=True) + text = text + " " + _("Quoting @{}: {}").format(quoted_user, quoted_text) + safe_text = safe_text + " " + _("Quoting @{}: {}").format(quoted_user, quoted_safe_text) filtered = utils.evaluate_filters(post=post, current_context="home") if filtered != None: text = _("hidden by filter {}").format(filtered)