]> git.0d.be Git - empathy.git/blobdiff - src/empathy-call-observer.c
Use a flat namespace for internal includes
[empathy.git] / src / empathy-call-observer.c
index 35ceeb046ee8d91a53ed55e0dfe3a73f9681f979..2a60f6fe2a68d452ed794e2c48a3e8b5e7efd80c 100644 (file)
  * Authors: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
  */
 
-#include <config.h>
+#include "config.h"
 
 #include <glib/gi18n-lib.h>
 
-#include <telepathy-glib/telepathy-glib.h>
-
-#include <libnotify/notification.h>
-
-#include <libempathy/empathy-utils.h>
-
-#include <libempathy-gtk/empathy-images.h>
-#include <libempathy-gtk/empathy-notify-manager.h>
-
-#include <extensions/extensions.h>
+#include "empathy-images.h"
+#include "empathy-notify-manager.h"
 
 #include "empathy-call-observer.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
+#include "empathy-debug.h"
 
 struct _EmpathyCallObserverPriv {
   EmpathyNotifyManager *notify_mgr;
@@ -102,29 +94,16 @@ auto_reject_ctx_free (AutoRejectCtx *ctx)
 }
 
 static void
-get_contact_cb (TpConnection *connection,
-    guint n_contacts,
-    TpContact * const *contacts,
-    guint n_failed,
-    const TpHandle *failed,
-    const GError *error,
-    gpointer user_data,
-    GObject *weak_object)
+display_reject_notification (EmpathyCallObserver *self,
+    TpChannel *channel)
 {
-  EmpathyCallObserver *self = (EmpathyCallObserver *) weak_object;
-  NotifyNotification *notification;
   TpContact *contact;
+  NotifyNotification *notification;
   gchar *summary, *body;
   EmpathyContact *emp_contact;
   GdkPixbuf *pixbuf;
 
-  if (n_contacts != 1)
-    {
-      DEBUG ("Failed to get TpContact; ignoring notification bubble");
-      return;
-    }
-
-  contact = contacts[0];
+  contact = tp_channel_get_target_contact (channel);
 
   summary = g_strdup_printf (_("Missed call from %s"),
       tp_contact_get_alias (contact));
@@ -132,7 +111,8 @@ get_contact_cb (TpConnection *connection,
       _("%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 (
@@ -152,21 +132,6 @@ get_contact_cb (TpConnection *connection,
   g_object_unref (emp_contact);
 }
 
-static void
-display_reject_notification (EmpathyCallObserver *self,
-    TpChannel *channel)
-{
-  TpHandle handle;
-  TpContactFeature features[] = { TP_CONTACT_FEATURE_ALIAS,
-      TP_CONTACT_FEATURE_AVATAR_DATA };
-
-  handle = tp_channel_get_handle (channel, NULL);
-
-  tp_connection_get_contacts_by_handle (tp_channel_borrow_connection (channel),
-      1, &handle, G_N_ELEMENTS (features), features, get_contact_cb,
-      g_object_ref (channel), g_object_unref, G_OBJECT (self));
-}
-
 static TpChannel *
 find_main_channel (GList *channels)
 {