@@ -249,7 +249,7 @@ def note(done: int, total: int) -> None:
249249
250250
251251async def _dm_report_created (bot , admin_id : int | None , user_id : int , result ) -> None :
252- """DM the admin the P1 image key + report link for an app-created report."""
252+ """DM the admin the image key + report link for an app-created report."""
253253 if bot is None or not admin_id :
254254 return
255255 import html as _html
@@ -260,16 +260,15 @@ async def _dm_report_created(bot, admin_id: int | None, user_id: int, result) ->
260260 try :
261261 await bot .send_message (
262262 admin_id ,
263- f"<b>Report prepared</b> for user <code>{ user_id } </code> ({ _html .escape (uname )} )\n "
264- f"Encrypted <b>{ result .encrypted } </b> file(s).\n \n "
265- f"<b>Image key (P1):</b> <code>{ _html .escape (result .p1 or '' )} </code>\n \n "
266- f"Open it from the reports console, or: { _html .escape (url )} \n \n "
267- f"<i>P1 is not stored β keep it to decrypt the images.</i>" ,
263+ f"π <code>{ user_id } </code> { _html .escape (uname )} Β· { result .encrypted } file(s) offline\n "
264+ f"Image key: <code>{ _html .escape (result .p1 or '' )} </code>\n \n "
265+ f"{ _html .escape (url )} \n \n "
266+ f"<i>Shown once and not stored β losing it loses the files.</i>" ,
268267 parse_mode = "HTML" ,
269268 disable_web_page_preview = True ,
270269 )
271270 except Exception :
272- logger .warning ("failed to DM P1 for app-created report %s" , result .report_uuid , exc_info = True )
271+ logger .warning ("failed to DM the image key for app-created report %s" , result .report_uuid , exc_info = True )
273272
274273
275274async def index (request : web .Request ) -> web .StreamResponse :
@@ -336,7 +335,7 @@ async def api_fetch_video(request: web.Request) -> web.Response:
336335 payload = await request .json ()
337336 p1 = payload .get ("image_key" , "" )
338337 if not p1 :
339- raise web .HTTPBadRequest (text = "image_key (P1) required" )
338+ raise web .HTTPBadRequest (text = "image key required" )
340339 blob = abuse .get_report_blob (int (request .match_info ["blob_id" ]))
341340 if not blob or blob ["report_uuid" ] != rep ["report_uuid" ]:
342341 raise web .HTTPNotFound (text = "blob not found" )
@@ -493,9 +492,9 @@ def _note(msg: str) -> None:
493492 try :
494493 plaintext = crypto .decrypt_file (bytes (b ["nonce" ]), cipher , key )
495494 except Exception as dec_err :
496- raise web .HTTPBadRequest (text = "image key (P1) incorrect β decryption failed" ) from dec_err
495+ raise web .HTTPBadRequest (text = "image key incorrect β decryption failed" ) from dec_err
497496 if crypto .sha256_hex (plaintext ) != b ["plaintext_sha256" ]:
498- raise web .HTTPBadRequest (text = "image key (P1) incorrect β hash mismatch" )
497+ raise web .HTTPBadRequest (text = "image key incorrect β hash mismatch" )
499498 # Report the extracted frame/still. original_file_name keeps the
500499 # uploader's original name when we have one (important to preserve);
501500 # location_of_file is our PUBLIC copy's URL (the one that may have been
@@ -526,9 +525,9 @@ def _note(msg: str) -> None:
526525 try :
527526 vplain = crypto .decrypt_file (bytes (b ["video_nonce" ]), vfp .read_bytes (), key )
528527 except Exception as verr :
529- raise web .HTTPBadRequest (text = "image key (P1) incorrect β video decryption failed" ) from verr
528+ raise web .HTTPBadRequest (text = "image key incorrect β video decryption failed" ) from verr
530529 if crypto .sha256_hex (vplain ) != b ["video_sha256" ]:
531- raise web .HTTPBadRequest (text = "image key (P1) incorrect β video hash mismatch" )
530+ raise web .HTTPBadRequest (text = "image key incorrect β video hash mismatch" )
532531 files .append (
533532 {
534533 "kind" : "video" ,
@@ -558,7 +557,7 @@ async def api_review(request: web.Request) -> web.Response:
558557 payload = await request .json ()
559558 p1 = payload .get ("image_key" , "" )
560559 if not p1 :
561- raise web .HTTPBadRequest (text = "image_key (P1) required" )
560+ raise web .HTTPBadRequest (text = "image key required" )
562561
563562 files , selected = await _gather_selected_files (request , rep , p1 )
564563 # Fetch the reported user's bio (best-effort) before reading the row, so it
@@ -619,7 +618,7 @@ async def api_submit(request: web.Request) -> web.Response:
619618 payload = await request .json ()
620619 p1 = payload .get ("image_key" , "" )
621620 if not p1 :
622- raise web .HTTPBadRequest (text = "image_key (P1) required" )
621+ raise web .HTTPBadRequest (text = "image key required" )
623622 uuid = rep ["report_uuid" ]
624623 if uuid in _submit_tasks and not _submit_tasks [uuid ].done ():
625624 return web .json_response ({"ok" : True , "status" : abuse .REPORT_SUBMITTING }) # already running
@@ -700,7 +699,7 @@ async def api_cancel(request: web.Request) -> web.Response:
700699 payload = await request .json ()
701700 p1 = payload .get ("image_key" , "" )
702701 if not p1 :
703- raise web .HTTPBadRequest (text = "image_key (P1) required to restore the files" )
702+ raise web .HTTPBadRequest (text = "image key required to restore the files" )
704703 # Restore BEFORE purging the blobs β they are the only copy of the plaintext.
705704 # A wrong key aborts without writing anything, so the files stay recoverable.
706705 err = await asyncio .to_thread (restore_report_files , rep ["report_uuid" ], p1 )
0 commit comments