aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:08:26 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:08:26 +0800
commit885555ee46acc4f4fe96b04b554ee3a0f2ae4baa (patch)
tree4830bba4a5321844ed15cf178e791c3d12a38215 /src
parent81562d740490d4032d93a6aaa8c32b7310023745 (diff)
downloadgsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.tar
gsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.tar.gz
gsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.tar.bz2
gsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.tar.lz
gsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.tar.xz
gsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.tar.zst
gsoc2013-empathy-885555ee46acc4f4fe96b04b554ee3a0f2ae4baa.zip
Always check if notifications are enabled when we update them.
svn path=/trunk/; revision=2301
Diffstat (limited to 'src')
-rw-r--r--src/empathy-status-icon.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index ceae25474..197b22401 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -128,11 +128,27 @@ get_pixbuf_for_event (EmpathyEvent *event)
}
static void
+notification_close_helper (EmpathyStatusIconPriv *priv)
+{
+ if (priv->notification) {
+ notify_notification_close (priv->notification, NULL);
+ g_object_unref (priv->notification);
+ priv->notification = NULL;
+ }
+}
+
+static void
status_icon_update_notification (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv = GET_PRIV (icon);
GdkPixbuf *pixbuf = NULL;
+ if (!empathy_notification_is_enabled ()) {
+ /* always close the notification if this happens */
+ notification_close_helper (priv);
+ return;
+ }
+
if (priv->event) {
pixbuf = get_pixbuf_for_event (priv->event);
@@ -156,11 +172,7 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
g_object_unref (pixbuf);
} else {
- if (priv->notification) {
- notify_notification_close (priv->notification, NULL);
- g_object_unref (priv->notification);
- priv->notification = NULL;
- }
+ notification_close_helper (priv);
}
}
@@ -234,10 +246,7 @@ status_icon_event_added_cb (EmpathyEventManager *manager,
status_icon_update_icon (icon);
status_icon_update_tooltip (icon);
-
- if (empathy_notification_is_enabled ()) {
- status_icon_update_notification (icon);
- }
+ status_icon_update_notification (icon);
if (!priv->blink_timeout) {
priv->blink_timeout = g_timeout_add (BLINK_TIMEOUT,