aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/notify.rs
diff options
context:
space:
mode:
authorEskil Queseth <eskilq@kth.se>2020-11-16 19:48:27 +0100
committerEskil Queseth <eskilq@kth.se>2020-11-16 19:48:27 +0100
commit292ba0307ebcf14ab8362f8f8f276a67d38a93ea (patch)
tree458aaa2e0da8c50d107dfbcb05f1e83d1ffc4c26 /mumd/src/notify.rs
parentac6b6e462f8dd7b6ab73e12b55de07b5019f232d (diff)
downloadmum-292ba0307ebcf14ab8362f8f8f276a67d38a93ea.tar.gz
change some things with extra features
Diffstat (limited to 'mumd/src/notify.rs')
-rw-r--r--mumd/src/notify.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/mumd/src/notify.rs b/mumd/src/notify.rs
index 0739c58..eaed3dc 100644
--- a/mumd/src/notify.rs
+++ b/mumd/src/notify.rs
@@ -1,9 +1,9 @@
pub fn init() {
- #[cfg(feature = "libnotify")]
+ #[cfg(any(feature = "notifications", feature = "all"))]
libnotify::init("mumd").unwrap();
}
-#[cfg(feature = "libnotify")]
+#[cfg(any(feature = "notifications", feature = "all"))]
pub fn send(msg: String) -> Option<bool> {
match libnotify::Notification::new("mumd", Some(msg.as_str()), None).show() {
Ok(_) => Some(true),
@@ -14,7 +14,7 @@ pub fn send(msg: String) -> Option<bool> {
}
}
-#[cfg(not(feature = "libnotify"))]
+#[cfg(not(any(feature = "notifications", feature = "all")))]
pub fn send(_: String) -> Option<bool> {
None
}