Commit 952374aab0

952374aab05e0a650a6c19e4d2ae29279ca9632b

parent: e99674b245

Unregistered key

VAWVAW <94846592+VAWVAW@users.noreply.github.com> · 2025-05-30 02:28 UTC
committer: <noreply@github.com>

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

Layout: unified · split

src/notifications.rs +4 −1
@@ -118,6 +118,9 @@ fn send_notification_desktop(summary: &str, body: Option<&str>) {
118 .icon(IAMB_XDG_NAME) 118 .icon(IAMB_XDG_NAME)
119 .action("default", "default"); 119 .action("default", "default");
120 120
121 #[cfg(all(unix, not(target_os = "macos")))]
122 desktop_notification.urgency(notify_rust::Urgency::Normal);
123
121 if let Some(body) = body { 124 if let Some(body) = body {
122 desktop_notification.body(body); 125 desktop_notification.body(body);
123 } 126 }
@@ -260,7 +263,7 @@ pub fn event_notification_body(event: &AnySyncTimelineEvent, sender_name: &str)
260} 263}
261 264
262fn truncate(s: String) -> String { 265fn truncate(s: String) -> String {
263 static MAX_LENGTH: usize = 100; 266 static MAX_LENGTH: usize = 5000;
264 if s.graphemes(true).count() > MAX_LENGTH { 267 if s.graphemes(true).count() > MAX_LENGTH {
265 let truncated: String = s.graphemes(true).take(MAX_LENGTH).collect(); 268 let truncated: String = s.graphemes(true).take(MAX_LENGTH).collect();
266 truncated + "..." 269 truncated + "..."