gitlab_tracker_notify/
lib.rs1#[cfg(feature = "desktop")]
11pub fn mr_on_new_branch(mr_id: &str, title: &str, branch: &str) {
12 let _ = notify_rust::Notification::new()
13 .summary("GitLab MR Tracker")
14 .body(&format!(
15 "MR !{} ({}) is now present on branch '{}'!",
16 mr_id, title, branch
17 ))
18 .icon("dialog-information")
19 .show();
20}
21
22#[cfg(feature = "desktop")]
24pub fn mr_updated(mr_id: &str, title: &str, updated_at: Option<&str>) {
25 let _ = notify_rust::Notification::new()
26 .summary(&format!("MR !{} updated", mr_id))
27 .body(&format!(
28 "{}\n{}",
29 title,
30 updated_at.unwrap_or("unknown date")
31 ))
32 .icon("dialog-information")
33 .show();
34}
35
36#[cfg(feature = "desktop")]
39pub fn mr_mergeability_changed(mr_id: &str, title: &str, old: &str, new: &str) {
40 let _ = notify_rust::Notification::new()
41 .summary(&format!("MR !{} — mergeability changed", mr_id))
42 .body(&format!("{}\n{} → {}", title, old, new))
43 .icon("dialog-warning")
44 .show();
45}
46
47#[cfg(feature = "desktop")]
49pub fn mr_milestone_changed(mr_id: &str, title: &str, old: &str, new: &str) {
50 let _ = notify_rust::Notification::new()
51 .summary(&format!("MR !{} — milestone changed", mr_id))
52 .body(&format!("{}\n{} → {}", title, old, new))
53 .icon("dialog-information")
54 .show();
55}
56
57#[cfg(not(feature = "desktop"))]
60#[inline(always)]
61pub fn mr_on_new_branch(_mr_id: &str, _title: &str, _branch: &str) {}
62
63#[cfg(not(feature = "desktop"))]
64#[inline(always)]
65pub fn mr_updated(_mr_id: &str, _title: &str, _updated_at: Option<&str>) {}
66
67#[cfg(not(feature = "desktop"))]
68#[inline(always)]
69pub fn mr_mergeability_changed(_mr_id: &str, _title: &str, _old: &str, _new: &str) {}
70
71#[cfg(not(feature = "desktop"))]
72#[inline(always)]
73pub fn mr_milestone_changed(_mr_id: &str, _title: &str, _old: &str, _new: &str) {}