Add show_post_flags configuration option and update post parsing to conditionally format flags based on this setting
This commit is contained in:
@@ -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"],
|
||||
}
|
||||
|
||||
@@ -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>'
|
||||
|
||||
Reference in New Issue
Block a user