Revert "Revert "make it possible to message someone by id""

This reverts commit fd17dab06c.
master
Aevann 2023-07-11 20:55:38 +03:00
parent ee12cd9d66
commit 251ed10cec
1 changed files with 3 additions and 3 deletions

View File

@ -736,11 +736,11 @@ def is_available(name:str):
else: else:
return {name: True} return {name: True}
@app.get("/id/<int:id>") @app.route("/id/<int:id>/<path:path>")
@limiter.limit(DEFAULT_RATELIMIT) @limiter.limit(DEFAULT_RATELIMIT)
def user_id(id): def user_id(id, path):
user = get_account(id) user = get_account(id)
return redirect(user.url) return redirect(f'/@{user.username}/{path}')
@app.get("/u/<username>") @app.get("/u/<username>")
@limiter.limit(DEFAULT_RATELIMIT) @limiter.limit(DEFAULT_RATELIMIT)