mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Search node aliases for mentions
Mentioning someone starts from their alias, but aliases are self-declared and unrelated nodes often share one. Results say who is followed or is you, so the composer can tell them apart. Co-Authored-By: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
co-authored by
Rūdolfs Ošiņš
parent
b461f0bce2
commit
bee84e9d40
@@ -145,6 +145,7 @@ pub fn router(shared: Shared) -> Router {
|
||||
.route("/startup", post(startup_handler))
|
||||
.route("/config", post(config_handler))
|
||||
.route("/alias", post(alias_handler))
|
||||
.route("/search_aliases", post(search_aliases_handler))
|
||||
.route("/authenticate", post(auth_handler))
|
||||
.route("/check_radicle_cli", post(check_radicle_cli_handler))
|
||||
.route("/node_running", post(node_running_handler))
|
||||
@@ -287,6 +288,18 @@ async fn node_running_handler(Ctx(ctx): Ctx) -> impl IntoResponse {
|
||||
Ok::<_, Error>(Json(ctx.node_running()))
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct SearchAliasesBody {
|
||||
pub query: Option<String>,
|
||||
}
|
||||
|
||||
async fn search_aliases_handler(
|
||||
Ctx(ctx): Ctx,
|
||||
Json(SearchAliasesBody { query }): Json<SearchAliasesBody>,
|
||||
) -> impl IntoResponse {
|
||||
Ok::<_, Error>(Json(ctx.search_aliases(query)))
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Options {
|
||||
show: Show,
|
||||
|
||||
Reference in New Issue
Block a user