()
| 18833 | out = [] |
| 18834 | for r in rows: |
| 18835 | msg = _discussion_build_message_dict(conn, dict(r), me) |
| 18836 | html_row = _render_discussion_row_html(msg, me) |
| 18837 | out.append({"id": int(msg["id"]), "sender": msg["sender"], "html": html_row}) |
| 18838 | finally: |
| 18839 | conn.close() |
| 18840 | |
| 18841 | return jsonify({"ok": True, "messages": out}) |
| 18842 | |
| 18843 | @app.route("/api/presence") |
| 18844 | @login_required |
| 18845 | def api_presence(): |
| 18846 | me = current_user() |
| 18847 | scope = current_scope() |
| 18848 | try: |
| 18849 | online = online_usernames(scope) |
| 18850 | except Exception: |
| 18851 | online = set() |
| 18852 | conn = db_connect() |
| 18853 | rows = conn.execute("SELECT username FROM users WHERE username<>?", (me,)).fetchall() |
| 18854 | conn.close() |
| 18855 | items = {r["username"]: (r["username"] in online) for r in rows} |
| 18856 | return jsonify({"ok": True, "items": items, "server_now": now_z()}) |
| 18857 | |
| 18858 | |
| 18859 | TEMPLATES["reports.html"] = r""" |
| 18860 | {% extends "base.html" %} |
| 18861 | {% block content %} |
nothing calls this directly
no test coverage detected