From 878847ce8967b76ddda0637f9e47895f5ef5723f Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Sun, 29 Mar 2026 11:11:28 +0400 Subject: [PATCH] fix: recognize @botfather as bot peer (special case, not pattern change) Co-Authored-By: Claude Opus 4.6 (1M context) --- warzone/crates/warzone-client/src/tui/commands.rs | 2 +- warzone/crates/warzone-server/src/routes/web.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/warzone/crates/warzone-client/src/tui/commands.rs b/warzone/crates/warzone-client/src/tui/commands.rs index 3fc5219..b77a84b 100644 --- a/warzone/crates/warzone-client/src/tui/commands.rs +++ b/warzone/crates/warzone-client/src/tui/commands.rs @@ -546,7 +546,7 @@ impl App { let url = format!("{}/v1/alias/whois/{}", client.base_url, normfp(&peer)); match client.client.get(&url).send().await { Ok(resp) => resp.json::().await.ok() - .and_then(|d| d.get("alias").and_then(|a| a.as_str().map(|s| s.ends_with("bot") || s.ends_with("Bot") || s.ends_with("_bot")))) + .and_then(|d| d.get("alias").and_then(|a| a.as_str().map(|s| s.ends_with("bot") || s.ends_with("Bot") || s.ends_with("_bot") || s == "botfather"))) .unwrap_or(false), Err(_) => false, } diff --git a/warzone/crates/warzone-server/src/routes/web.rs b/warzone/crates/warzone-server/src/routes/web.rs index 5d6276b..ca42e43 100644 --- a/warzone/crates/warzone-server/src/routes/web.rs +++ b/warzone/crates/warzone-server/src/routes/web.rs @@ -1210,7 +1210,7 @@ async function doSend() { try { const wr = await fetch(SERVER + '/v1/alias/whois/' + normFP(peer)); const wd = await wr.json(); - if (wd.alias && (wd.alias.endsWith('bot') || wd.alias.endsWith('Bot') || wd.alias.endsWith('_bot'))) isBotPeer = true; + if (wd.alias && (wd.alias.endsWith('bot') || wd.alias.endsWith('Bot') || wd.alias.endsWith('_bot') || wd.alias === 'botfather')) isBotPeer = true; } catch(e) {} if (isBotPeer) {