story-kit: merge 322_story_whatsapp_24_hour_messaging_window_and_template_support

This commit is contained in:
Dave
2026-03-19 23:58:31 +00:00
parent e3ade4cca5
commit 02947700ba
6 changed files with 496 additions and 16 deletions

View File

@@ -199,9 +199,14 @@ async fn main() -> Result<(), std::io::Error> {
.and_then(|root| matrix::BotConfig::load(root))
.filter(|cfg| cfg.transport == "whatsapp")
.map(|cfg| {
let template_name = cfg
.whatsapp_notification_template
.clone()
.unwrap_or_else(|| "pipeline_notification".to_string());
let transport = Arc::new(whatsapp::WhatsAppTransport::new(
cfg.whatsapp_phone_number_id.clone().unwrap_or_default(),
cfg.whatsapp_access_token.clone().unwrap_or_default(),
template_name,
));
let bot_name = cfg
.display_name
@@ -219,6 +224,7 @@ async fn main() -> Result<(), std::io::Error> {
ambient_rooms: Arc::new(std::sync::Mutex::new(std::collections::HashSet::new())),
history: std::sync::Arc::new(tokio::sync::Mutex::new(history)),
history_size: cfg.history_size,
window_tracker: Arc::new(whatsapp::MessagingWindowTracker::new()),
})
});