From e71b5b91beafe66fc81713dac7debbfe5146d19d Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Sat, 1 Jun 2024 16:37:39 +0100 Subject: [PATCH] Add message length truncation --- src/event_news.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/event_news.rs b/src/event_news.rs index cc53353..8ed1230 100644 --- a/src/event_news.rs +++ b/src/event_news.rs @@ -11,7 +11,10 @@ impl EventExt for Event { let venue = Venue::from_schedule_name(&self.venue); let news_number = news_number_for_venue(&venue); - let msg = format!("<{}> {}", venue_short_name(venue), self.title); + let mut msg = format!("<{}> {}", venue_short_name(venue), self.title); + if msg.len() > 80 { + msg = format!("{}...", &msg[0..77]); + } match OutgoingNewsBuilder::default() .rubric("emfcamp".to_string())