aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-01-03 20:04:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-01-03 20:08:05 +0800
commit12b23410bd90309789d3f3b5206f0cde015c31b0 (patch)
tree1f4f50b3828d7db65469253563599a31992f7b0a
parent079d54dd90b551a5ca520a244fc93933d13d942d (diff)
downloadgsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.tar
gsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.tar.gz
gsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.tar.bz2
gsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.tar.lz
gsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.tar.xz
gsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.tar.zst
gsoc2013-empathy-12b23410bd90309789d3f3b5206f0cde015c31b0.zip
factor out empathy_notify_manager_create_notification()
https://bugzilla.gnome.org/show_bug.cgi?id=691043
-rw-r--r--libempathy-gtk/empathy-notify-manager.c12
-rw-r--r--libempathy-gtk/empathy-notify-manager.h7
-rw-r--r--src/empathy-call-observer.c3
-rw-r--r--src/empathy-chat-window.c4
-rw-r--r--src/empathy-notifications-approver.c4
5 files changed, 26 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c
index 250354282..89ab3c1c8 100644
--- a/libempathy-gtk/empathy-notify-manager.c
+++ b/libempathy-gtk/empathy-notify-manager.c
@@ -216,3 +216,15 @@ empathy_notify_manager_notification_is_enabled (EmpathyNotifyManager *self)
return TRUE;
}
+
+NotifyNotification *
+empathy_notify_manager_create_notification (const gchar *summary,
+ const char *body,
+ const gchar *icon)
+{
+ NotifyNotification *notification;
+
+ notification = notify_notification_new (summary, body, icon);
+
+ return notification;
+}
diff --git a/libempathy-gtk/empathy-notify-manager.h b/libempathy-gtk/empathy-notify-manager.h
index 0b937e1d5..53c7b38f9 100644
--- a/libempathy-gtk/empathy-notify-manager.h
+++ b/libempathy-gtk/empathy-notify-manager.h
@@ -25,6 +25,8 @@
#include <libempathy/empathy-contact.h>
+#include <libnotify/notification.h>
+
G_BEGIN_DECLS
#define EMPATHY_NOTIFY_MANAGER_CAP_ACTIONS "actions"
@@ -104,6 +106,11 @@ GdkPixbuf * empathy_notify_manager_get_pixbuf_for_notification (
EmpathyContact *contact,
const char *icon_name);
+NotifyNotification * empathy_notify_manager_create_notification (
+ const gchar *summary,
+ const char *body,
+ const gchar *icon);
+
G_END_DECLS
#endif /* __EMPATHY_NOTIFY_MANAGER_H__ */
diff --git a/src/empathy-call-observer.c b/src/empathy-call-observer.c
index de21506d5..385fce1c4 100644
--- a/src/empathy-call-observer.c
+++ b/src/empathy-call-observer.c
@@ -119,7 +119,8 @@ display_reject_notification (EmpathyCallObserver *self,
_("%s just tried to call you, but you were in another call."),
tp_contact_get_alias (contact));
- notification = notify_notification_new (summary, body, NULL);
+ notification = empathy_notify_manager_create_notification (summary, body,
+ NULL);
emp_contact = empathy_contact_dup_from_tp_contact (contact);
pixbuf = empathy_notify_manager_get_pixbuf_for_notification (
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index b971daff4..06d1b0cec 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1574,7 +1574,9 @@ chat_window_show_or_update_notification (EmpathyChatWindow *self,
const gchar *category = empathy_chat_is_room (chat)
? EMPATHY_NOTIFICATION_CATEGORY_MENTIONED
: EMPATHY_NOTIFICATION_CATEGORY_CHAT;
- notification = notify_notification_new (header, escaped, NULL);
+
+ notification = empathy_notify_manager_create_notification (header,
+ escaped, NULL);
if (self->priv->notification == NULL)
self->priv->notification = notification;
diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c
index aa5b00fba..2f42c7613 100644
--- a/src/empathy-notifications-approver.c
+++ b/src/empathy-notifications-approver.c
@@ -339,8 +339,8 @@ update_notification (EmpathyNotificationsApprover *self)
* to an existing notification with the same title.
* In this way the previous message will not be lost: the new
* message will appear below it, in the same notification */
- notification = notify_notification_new (self->priv->event->header,
- message_esc, NULL);
+ notification = empathy_notify_manager_create_notification (
+ self->priv->event->header, message_esc, NULL);
if (self->priv->notification == NULL)
{