Show more text in notifications and use "normal" urgency for dbus notifications (#430)

This commit is contained in:
VAWVAW 2025-05-30 02:28:08 +00:00 committed by GitHub
parent e99674b245
commit 952374aab0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,6 +118,9 @@ fn send_notification_desktop(summary: &str, body: Option<&str>) {
.icon(IAMB_XDG_NAME)
.action("default", "default");
#[cfg(all(unix, not(target_os = "macos")))]
desktop_notification.urgency(notify_rust::Urgency::Normal);
if let Some(body) = body {
desktop_notification.body(body);
}
@ -260,7 +263,7 @@ pub fn event_notification_body(event: &AnySyncTimelineEvent, sender_name: &str)
}
fn truncate(s: String) -> String {
static MAX_LENGTH: usize = 100;
static MAX_LENGTH: usize = 5000;
if s.graphemes(true).count() > MAX_LENGTH {
let truncated: String = s.graphemes(true).take(MAX_LENGTH).collect();
truncated + "..."