From bd36eff5533cf4021316a12dd9608dd21392cd1a Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 30 Jan 2009 17:08:17 +0000 Subject: [PATCH] Add an enum to define notification close reason. svn path=/trunk/; revision=2298 --- src/empathy-chat-window.c | 4 ++-- src/empathy-misc.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 90091c79..fdf1f544 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -845,13 +845,13 @@ static void chat_window_notification_closed_cb (NotifyNotification *notify, NotificationData *cb_data) { - int reason = 1; + int reason = 0; EmpathyChatWindowPriv *priv = GET_PRIV (cb_data->window); #ifdef notify_notification_get_closed_reason reason = notify_notification_get_closed_reason (notify); #endif - if (reason == 2) { + if (reason == NOTIFICATION_CLOSED_DISMISSED) { empathy_chat_window_present_chat (cb_data->chat); } diff --git a/src/empathy-misc.h b/src/empathy-misc.h index 6bc3e2b2..cc407b4b 100644 --- a/src/empathy-misc.h +++ b/src/empathy-misc.h @@ -28,6 +28,15 @@ G_BEGIN_DECLS +/* FIXME: this should *really* belong to libnotify. */ +typedef enum { + NOTIFICATION_CLOSED_INVALID = 0, + NOTIFICATION_CLOSED_EXPIRED = 1, + NOTIFICATION_CLOSED_DISMISSED = 2, + NOTIFICATION_CLOSED_PROGRAMMATICALY = 3, + NOTIFICATION_CLOSED_RESERVED = 4 +} NotificationClosedReason; + gboolean empathy_notification_is_enabled (void); G_END_DECLS -- 2.39.2