Add show_post_flags configuration option and update post parsing to conditionally format flags based on this setting

This commit is contained in:
vvzvlad
2025-03-21 14:40:32 +03:00
parent a65fb05ae4
commit e58fca0821
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -19,4 +19,5 @@ def get_settings():
"token": os.getenv("TOKEN", ""),
"time_based_merge": os.getenv("TIME_BASED_MERGE", "False").strip() in ["True", "true"],
"show_bridge_link": os.getenv("SHOW_BRIDGE_LINK", "False").strip() in ["True", "true"],
"show_post_flags": os.getenv("SHOW_POST_FLAGS", "False").strip() in ["True", "true"],
}
+3
View File
@@ -285,6 +285,9 @@ class PostParser:
return html_content
def _format_flags(self, message: Message) -> str:
if not Config['show_post_flags']:
return ''
flags = self._extract_flags(message)
if flags:
return f'<div class="message-flags">Flags: {", ".join(flags)}</div>'