]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 1 Oct 2024 17:00:37 +0000 (19:00 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 1 Oct 2024 17:00:37 +0000 (19:00 +0200)
- now also command recheck_obfuscation() is updating/adding 'obfucated' a record

fba/commands.py

index d862ce14593d6e039182aa4b81ed8845c8a9cd8b..5efea1b8482ac533a9038b466587479e26f5ebd5 100644 (file)
@@ -1440,11 +1440,19 @@ def recheck_obfuscation(args: argparse.Namespace) -> int:
                 logger.debug("block[block_level]='%s' - AFTER!", block["block_level"])
 
                 if processing.block(row["domain"], blocked, block["reason"], block["block_level"]) and block["block_level"] in ["suspended", "rejected"] and config.get("bot_enabled"):
-                    logger.debug("Appending blocked='%s',reason='%s' for blocker='%s' ...", block["blocked"], block["block_level"], row["domain"])
+                    logger.debug("Appending blocked='%s',reason='%s' for blocker='%s' ...", blocked, block["block_level"], row["domain"])
                     blockdict.append({
                         "blocked": blocked,
                         "reason" : block["reason"],
                     })
+            elif blocked is not None:
+                logger.debug("blocked='%s' is maybe added and needs update.", blocked)
+                if not obfuscation.is_added(block["blocked"]):
+                    logger.debug("Invoking obfuscation.add(%s) ...", block["blocked"])
+                    obfuscation.add(block["blocked"])
+                else:
+                    logger.debug("Invoking obfuscation.update(%s) ...", block["blocked"])
+                    obfuscation.update(block["blocked"])
 
         logger.debug("Setting obfuscated=%d for row[domain]='%s' ...", obfuscated, row["domain"])
         instances.set_obfuscated_blocks(row["domain"], obfuscated)