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

Function _stories_for_user

Scripts/ButSystem.py:18667–18695  ·  view source on GitHub ↗
(username: str)

Source from the content-addressed store, hash-verified

18665 # Size limits (33MB) for chat stability.
18666 if voice and getattr(voice, "filename", ""):
18667 vsz = _filestorage_size(voice)
18668 if vsz is not None and vsz > CHAT_MAX_BYTES:
18669 if is_ajax:
18670 return jsonify(ok=False, error=_("Voice message too large (max 33MB).")), 413
18671 flash(_("Voice message too large (max 33MB)."))
18672 return redirect(url_for("discussion"))
18673 if upfile and getattr(upfile, "filename", ""):
18674 fsz = _filestorage_size(upfile)
18675 if fsz is not None and fsz > CHAT_MAX_BYTES:
18676 if is_ajax:
18677 return jsonify(ok=False, error=_("File too large (max 33MB).")), 413
18678 flash(_("File too large (max 33MB)."))
18679 return redirect(url_for("discussion"))
18680 if gif and getattr(gif, "filename", ""):
18681 gsz = _filestorage_size(gif)
18682 if gsz is not None and gsz > CHAT_MAX_BYTES:
18683 if is_ajax:
18684 return jsonify(ok=False, error=_("GIF too large (max 33MB).")), 413
18685 flash(_("GIF too large (max 33MB)."))
18686 return redirect(url_for("discussion"))
18687
18688 chosen_file = (
18689 upfile if (upfile and getattr(upfile, "filename", "")) else (gif if (gif and getattr(gif, "filename", "")) else None)
18690 )
18691
18692 if voice and getattr(voice, "filename", ""):
18693 try:
18694 _validate_chat_voice_upload(voice)
18695 except ValueError as ve:
18696 msg = _("Unsupported voice file type.")
18697 if str(ve) == "forbidden_type":
18698 msg = _("Forbidden file type.")

Callers 1

story_view_userFunction · 0.70

Calls 6

_stories_tables_initFunction · 0.70
db_connectFunction · 0.70
_story_cutoff_zFunction · 0.70
_story_is_mediaFunction · 0.70
human_sizeFunction · 0.70
_local_time_strFunction · 0.70

Tested by

no test coverage detected