fix: remove unused import and correct WhatsApp/Email registry status
- Remove unused `std::fmt::Write` import in `load_openclaw_bootstrap_files` (eliminates compiler warning) - Update WhatsApp integration status from ComingSoon to config-driven (implementation exists in channels/whatsapp.rs) - Update Email integration status from ComingSoon to config-driven (implementation exists in channels/email_channel.rs) - Update tests to reflect corrected integration statuses Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dfe648d5ae
commit
e057bf4128
2 changed files with 39 additions and 6 deletions
|
|
@ -55,9 +55,15 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
|
|||
},
|
||||
IntegrationEntry {
|
||||
name: "WhatsApp",
|
||||
description: "QR pairing via web bridge",
|
||||
description: "Meta Cloud API via webhook",
|
||||
category: IntegrationCategory::Chat,
|
||||
status_fn: |_| IntegrationStatus::ComingSoon,
|
||||
status_fn: |c| {
|
||||
if c.channels_config.whatsapp.is_some() {
|
||||
IntegrationStatus::Active
|
||||
} else {
|
||||
IntegrationStatus::Available
|
||||
}
|
||||
},
|
||||
},
|
||||
IntegrationEntry {
|
||||
name: "Signal",
|
||||
|
|
@ -614,9 +620,15 @@ pub fn all_integrations() -> Vec<IntegrationEntry> {
|
|||
},
|
||||
IntegrationEntry {
|
||||
name: "Email",
|
||||
description: "Send & read emails",
|
||||
description: "IMAP/SMTP email channel",
|
||||
category: IntegrationCategory::Social,
|
||||
status_fn: |_| IntegrationStatus::ComingSoon,
|
||||
status_fn: |c| {
|
||||
if c.channels_config.email.is_some() {
|
||||
IntegrationStatus::Active
|
||||
} else {
|
||||
IntegrationStatus::Available
|
||||
}
|
||||
},
|
||||
},
|
||||
// ── Platforms ───────────────────────────────────────────
|
||||
IntegrationEntry {
|
||||
|
|
@ -798,7 +810,7 @@ mod tests {
|
|||
fn coming_soon_integrations_stay_coming_soon() {
|
||||
let config = Config::default();
|
||||
let entries = all_integrations();
|
||||
for name in ["WhatsApp", "Signal", "Nostr", "Spotify", "Home Assistant"] {
|
||||
for name in ["Signal", "Nostr", "Spotify", "Home Assistant"] {
|
||||
let entry = entries.iter().find(|e| e.name == name).unwrap();
|
||||
assert!(
|
||||
matches!((entry.status_fn)(&config), IntegrationStatus::ComingSoon),
|
||||
|
|
@ -807,6 +819,28 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn whatsapp_available_when_not_configured() {
|
||||
let config = Config::default();
|
||||
let entries = all_integrations();
|
||||
let wa = entries.iter().find(|e| e.name == "WhatsApp").unwrap();
|
||||
assert!(matches!(
|
||||
(wa.status_fn)(&config),
|
||||
IntegrationStatus::Available
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn email_available_when_not_configured() {
|
||||
let config = Config::default();
|
||||
let entries = all_integrations();
|
||||
let email = entries.iter().find(|e| e.name == "Email").unwrap();
|
||||
assert!(matches!(
|
||||
(email.status_fn)(&config),
|
||||
IntegrationStatus::Available
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shell_and_filesystem_always_active() {
|
||||
let config = Config::default();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue