MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / api_dm_delete

Function api_dm_delete

Scripts/ButSystem.py:13971–14017  ·  view source on GitHub ↗

api_dm_delete. Chat/group feature helper or route handler. This docstring was expanded to make future maintenance easier. Args: mid: Parameter. Returns: Varies.

(mid: int)

Source from the content-addressed store, hash-verified

13969 return Response(gen, mimetype=mime, headers=headers)
13970 except Exception:
13971 abort(404)
13972
13973 from flask import send_file
13974 return send_file(sp, mimetype=mime, as_attachment=True, download_name=filename)
13975
13976
13977@app.route("/discussion/voice/<int:vid>")
13978@login_required
13979def discussion_voice_stream(vid: int):
13980 """Stream a Discussion voice message."""
13981 _feature_tables_init()
13982 conn = db_connect()
13983 row = conn.execute("""
13984 SELECT id, mime, stored_path
13985 FROM discussion_voice
13986 WHERE id=?
13987 """, (vid,)).fetchone()
13988 conn.close()
13989 if not row:
13990 abort(404)
13991
13992 sp = row["stored_path"]
13993 if not sp or not os.path.exists(sp):
13994 abort(404)
13995
13996 mime = row["mime"] or "audio/webm"
13997 try:
13998 if is_encrypted_file(sp):
13999 gen = aesgcm_decrypt_generator(sp)
14000 resp = Response(gen, mimetype=mime)
14001 else:
14002 from flask import send_file
14003 resp = send_file(sp, mimetype=mime, as_attachment=False, conditional=True, max_age=0)
14004 except Exception:
14005 abort(404)
14006
14007 resp.headers["Cache-Control"] = "no-store"
14008 return resp
14009
14010@app.route("/chats")
14011@login_required
14012def chats():
14013 """chats.
14014
14015Route handler or application helper.
14016
14017This docstring was expanded to make future maintenance easier.
14018
14019Returns:
14020 Varies.

Callers

nothing calls this directly

Calls 4

current_userFunction · 0.70
db_connectFunction · 0.70
aesgcm_encrypt_textFunction · 0.70
now_zFunction · 0.70

Tested by

no test coverage detected