Store a group voice message using an existing DB connection/transaction.
(conn, gm_id: int, file_storage)
| 14674 | "created_at_utc": r["created_at"], |
| 14675 | "read_at_local": _local_time_str(r["read_at"]) if r["sender"] == me else None, |
| 14676 | "read_at_utc": r["read_at"] if r["sender"] == me else None, |
| 14677 | "edited_at_local": _local_time_str(r["edited_at"]) if r["edited_at"] else None, |
| 14678 | "voice_id": v["id"] if v else None, |
| 14679 | "voice_mime": v["mime"] if v else "audio/webm", |
| 14680 | "file_id": f["id"] if f else None, |
| 14681 | "file_name": f["filename"] if f else None, |
| 14682 | "file_mime": f["mime"] if f else None, |
| 14683 | "file_size_h": human_size(int(f["size"])) if (f and f["size"] is not None) else "", |
| 14684 | "file_is_image": True if (f and (f["mime"] or "").startswith("image/")) else False, |
| 14685 | "file_is_video": True if (f and (f["mime"] or "").startswith("video/")) else False, |
| 14686 | "file_is_audio": True if (f and (f["mime"] or "").startswith("audio/")) else False |
| 14687 | }) |
| 14688 | if want_html: |
| 14689 | try: |
| 14690 | out[-1]['html'] = _render_dm_row_html(out[-1], me) |
| 14691 | except Exception: |
| 14692 | pass |
| 14693 | # Status updates for delivery/seen ticks (for messages I sent to this peer). |
| 14694 | status_since = (request.args.get("status_since") or "").strip() |
| 14695 | if not status_since: |
no test coverage detected