From 75383b1d3c343549955eb76b6dec007b31b3a4a8 Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 17 May 2025 23:00:09 -0700 Subject: Ensure user understands program purpose --- matrix-redact.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/matrix-redact.py b/matrix-redact.py index 8be0605..39a83bc 100644 --- a/matrix-redact.py +++ b/matrix-redact.py @@ -4,6 +4,8 @@ matrix-redact: Delete all messages and media a user has sent in a matrix room. """ +import random +import math import asyncio import argparse import getpass @@ -40,6 +42,36 @@ async def redact_room() -> None: return None async def main(args) -> None: + print("\n" + "="*80) + print("WARNING: THIS PROGRAM PERFORMS A PERMANENT DESTRUCTIVE ACTION IN A PROVIDED MATRIX ROOM.") + print(""" + This program will (applies only to a provided room and user ID): + - Delete all user-uploaded media (images, files, etc.) + - Delete all messages you've sent + - Delete any other content you've posted + - Operate *irreversibly* on the room ID you provide + - Act as the logged-in user on the specified homeserver + + THIS ACTION CANNOT BE UNDONE. + + Make absolutely sure you understand what this program does before proceeding. + We take zero liability for any misuse of this program. + """) + + confirmation = input("Type 'YES I UNDERSTAND' to continue: ") + if confirmation != "YES I UNDERSTAND": + print("Exiting.") + sys.exit(1) + + x = random.randint(2, 12) + a = random.randint(2, 12) + b = a * x + + print(f"Solve this: {a} * x = {b}") + if int(input("Answer: ").strip()) != x: + print("Incorrect math solution. Exiting.") + sys.exit(1) + client = None try: -- cgit v1.2.3