If there is an active call between me and peer, return call_id (used to start polling).
(peer: str)
| 14066 | This docstring was expanded to make future maintenance easier. |
| 14067 | |
| 14068 | Args: |
| 14069 | username: Parameter. |
| 14070 | |
| 14071 | Returns: |
| 14072 | Varies. |
| 14073 | """ |
| 14074 | me = current_user() |
| 14075 | username = username.strip() |
| 14076 | peer_display = username |
| 14077 | is_self_chat = (username == me) |
| 14078 | if is_self_chat: |
| 14079 | peer_display = "Saved messages" |
| 14080 | |
| 14081 | conn = db_connect() |
| 14082 | exists = conn.execute("SELECT 1 FROM users WHERE username=?", (username,)).fetchone() |
| 14083 | if not exists: |
| 14084 | conn.close() |
| 14085 | flash("User not found.") |
| 14086 | return redirect(url_for("chats")) |
nothing calls this directly
no test coverage detected