From a46ca96ffc7ac5f9560f3e7834974ca3f34df62d Mon Sep 17 00:00:00 2001 From: Jason Conti Date: Sat, 25 Feb 2012 13:44:13 -0500 Subject: * Add notification_is_empty to catch useless notifications such as brightness and volume, which are not always properly marked. --- src/notification.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/notification.c') diff --git a/src/notification.c b/src/notification.c index c76da87..0788ec2 100644 --- a/src/notification.c +++ b/src/notification.c @@ -188,6 +188,16 @@ notification_is_volume(Notification *self) return self->priv->is_volume; } +/** + * A notification is considered empty if both the summary and body do not + * contain any text. + */ +gboolean +notification_is_empty(Notification *self) +{ + return (self->priv->summary_length == 0) && (self->priv->body_length == 0); +} + void notification_print(Notification *self) { -- cgit v1.2.3