diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-12 20:20:12 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-13 19:37:18 +0800 |
commit | 9237fdc11b953a9201f9123789517b2d11c3bf34 (patch) | |
tree | 8b6bd3ae3602b2bfeace7ff835bcadfff76209e3 /src | |
parent | 73729806f2214306477756690ebbf8469d4ffe17 (diff) | |
download | gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.tar gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.tar.gz gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.tar.bz2 gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.tar.lz gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.tar.xz gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.tar.zst gsoc2013-empathy-9237fdc11b953a9201f9123789517b2d11c3bf34.zip |
status-icon: use EmpathyNotifyManager to check if the server supports the 'actions' capa
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-status-icon.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c index c2faaea02..830e6dbd6 100644 --- a/src/empathy-status-icon.c +++ b/src/empathy-status-icon.c @@ -43,6 +43,7 @@ #include <libempathy-gtk/empathy-ui-utils.h> #include <libempathy-gtk/empathy-images.h> #include <libempathy-gtk/empathy-new-message-dialog.h> +#include <libempathy-gtk/empathy-notify-manager.h> #include "empathy-accounts-dialog.h" #include "empathy-status-icon.h" @@ -61,6 +62,7 @@ typedef struct { GtkStatusIcon *icon; EmpathyIdle *idle; TpAccountManager *account_manager; + EmpathyNotifyManager *notify_mgr; gboolean showing_event_icon; guint blink_timeout; EmpathyEventManager *event_manager; @@ -73,7 +75,6 @@ typedef struct { GtkAction *show_window_item; GtkAction *new_message_item; GtkAction *status_item; - gboolean notify_supports_actions; } EmpathyStatusIconPriv; G_DEFINE_TYPE (EmpathyStatusIcon, empathy_status_icon, G_TYPE_OBJECT); @@ -173,7 +174,7 @@ status_icon_update_notification (EmpathyStatusIcon *icon) notify_notification_set_timeout (priv->notification, NOTIFY_EXPIRES_DEFAULT); - if (priv->notify_supports_actions) { + if (empathy_notify_manager_has_capability (priv->notify_mgr, "actions")) { notify_notification_add_action (priv->notification, "respond", _("Respond"), @@ -552,6 +553,7 @@ status_icon_finalize (GObject *object) g_object_unref (priv->account_manager); g_object_unref (priv->event_manager); g_object_unref (priv->ui_manager); + g_object_unref (priv->notify_mgr); } static void @@ -594,7 +596,6 @@ empathy_status_icon_init (EmpathyStatusIcon *icon) { EmpathyStatusIconPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, EMPATHY_TYPE_STATUS_ICON, EmpathyStatusIconPriv); - GList *list, *l; icon->priv = priv; priv->icon = gtk_status_icon_new (); @@ -634,15 +635,7 @@ empathy_status_icon_init (EmpathyStatusIcon *icon) icon); /* Query the notification daemon to check if it supports actions */ - priv->notify_supports_actions = FALSE; - list = notify_get_server_caps (); - for (l = list; l != NULL; l = g_list_next (l)) { - gchar *caps = l->data; - if (!tp_strdiff (caps, "actions")) - priv->notify_supports_actions = TRUE; - g_free (caps); - } - g_list_free (list); + priv->notify_mgr = empathy_notify_manager_dup_singleton (); } EmpathyStatusIcon * |