diff options
author | Jason Conti <jason.conti@gmail.com> | 2012-02-25 13:44:13 -0500 |
---|---|---|
committer | Jason Conti <jason.conti@gmail.com> | 2012-02-25 13:44:13 -0500 |
commit | c5c8e93e9fb39f4ec801c2a74440de5210d39633 (patch) | |
tree | 181a805edefeaa4cad38cfb773e38dd59d2f951d /src/notification.c | |
parent | 0c4510aad6914301bdbf5c7e74b54493c947218c (diff) | |
download | ayatana-indicator-notifications-c5c8e93e9fb39f4ec801c2a74440de5210d39633.tar.gz ayatana-indicator-notifications-c5c8e93e9fb39f4ec801c2a74440de5210d39633.tar.bz2 ayatana-indicator-notifications-c5c8e93e9fb39f4ec801c2a74440de5210d39633.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.c | 10 |
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) { |