From c2efdd084263e0ae20f080d5fa34fa6ac2c94384 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 9 Jul 2017 19:30:49 +0200 Subject: [PATCH] Add Notification::set_category() --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f6ad9650..e3e3ce7e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -286,6 +286,18 @@ impl<'a> Notification<'a> { return Ok(()); } + + /// Sets the category of this notification. This can be used by the + /// notification server to filter or display the data in a certain way. + pub fn set_category(&self, category: &str) -> Result<(), NotificationCreationError> { + let category = try!(CString::new(category)); + unsafe { + sys::notify_notification_set_category(self.handle, + category.as_ptr()); + } + + return Ok(()); + } }