From a22eac0c6fa0c0f162062628fb70b1391db98f04 Mon Sep 17 00:00:00 2001 From: Vftdan Date: Mon, 1 Jul 2024 18:37:12 +0200 Subject: [PATCH] Add an '--no-skip-replies' argument to override replies_to_other_accounts_should_not_be_skipped option --- mastoposter/__main__.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mastoposter/__main__.py b/mastoposter/__main__.py index 37b4a0b..81adc06 100644 --- a/mastoposter/__main__.py +++ b/mastoposter/__main__.py @@ -114,6 +114,10 @@ def main(): "--single-status", nargs="?", type=str, help="process single status and exit" ) + parser.add_argument( + "--no-skip-replies", action="store_true", + help="override replies_to_other_accounts_should_not_be_skipped to true" + ) args = parser.parse_args() if not args.config: @@ -146,14 +150,20 @@ def main(): "wss://{}/api/v1/streaming".format(conf["main"]["instance"]), ) + replies_to_other_accounts_should_not_be_skipped = conf[ + "main" + ].getboolean( + "replies_to_other_accounts_should_not_be_skipped", False + ) + + if args.no_skip_replies: + replies_to_other_accounts_should_not_be_skipped = True + source = websocket_source source_params = dict( url=url, - replies_to_other_accounts_should_not_be_skipped=conf[ - "main" - ].getboolean( - "replies_to_other_accounts_should_not_be_skipped", False - ), + replies_to_other_accounts_should_not_be_skipped=( + replies_to_other_accounts_should_not_be_skipped), reconnect=conf["main"].getboolean("auto_reconnect", False), reconnect_delay=conf["main"].getfloat("reconnect_delay", 1.0), connect_timeout=conf["main"].getfloat("connect_timeout", 60.0),