aboutsummaryrefslogtreecommitdiff
path: root/src/notification.c
diff options
context:
space:
mode:
authorJason Conti <jason.conti@gmail.com>2012-02-25 13:44:13 -0500
committerJason Conti <jason.conti@gmail.com>2012-02-25 13:44:13 -0500
commita46ca96ffc7ac5f9560f3e7834974ca3f34df62d (patch)
tree181a805edefeaa4cad38cfb773e38dd59d2f951d /src/notification.c
parent67121606d72de0fa953f02f481c7b4b37adac0fb (diff)
downloadayatana-indicator-notifications-a46ca96ffc7ac5f9560f3e7834974ca3f34df62d.tar.gz
ayatana-indicator-notifications-a46ca96ffc7ac5f9560f3e7834974ca3f34df62d.tar.bz2
ayatana-indicator-notifications-a46ca96ffc7ac5f9560f3e7834974ca3f34df62d.zip
* Add notification_is_empty to catch useless notifications such as
brightness and volume, which are not always properly marked.
Diffstat (limited to 'src/notification.c')
-rw-r--r--src/notification.c10
1 files changed, 10 insertions, 0 deletions
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)
{