()
| 15759 | conn.close() |
| 15760 | |
| 15761 | return render_template("group_chat.html", title="Group chat", |
| 15762 | g=Obj(g_row), my_role=role, members=[type("M", (), m)() for m in members], |
| 15763 | all_users=all_usernames(), me=me, messages=messages, has_group_pin=has_group_pin) |
| 15764 | |
| 15765 | @app.route("/groups/<int:gid>/send", methods=["POST"]) |
| 15766 | @login_required |
| 15767 | def group_send(gid: int): |
| 15768 | """Send a group message (text and/or voice) without forcing a page refresh when called via AJAX. |
| 15769 | |
| 15770 | Stability: |
| 15771 | - Commit the group message + voice attachment atomically (single transaction) |
| 15772 | so polling clients never see a blank placeholder voice row. |
| 15773 | """ |
| 15774 | me = current_user() |
| 15775 | role = group_role(gid, me) |
| 15776 | if not _chat_lock_is_unlocked(me, "group", gid): |
| 15777 | return _locked_json_or_redirect("group", gid) |
| 15778 | if not role: |
| 15779 | abort(403) |
| 15780 | |
| 15781 | is_ajax = ( |
nothing calls this directly
no test coverage detected