aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-08 16:37:34 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-08 16:39:09 +0800
commit4723b7016072a1cd4f41dfddcf990d97d68def36 (patch)
tree7d59f764ac4e2c95f137a62d453d15661dd85a08
parentd86e51de57197b0f0ce77fac46fc113713aa9033 (diff)
downloadgsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.tar
gsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.tar.gz
gsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.tar.bz2
gsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.tar.lz
gsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.tar.xz
gsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.tar.zst
gsoc2013-empathy-4723b7016072a1cd4f41dfddcf990d97d68def36.zip
call-observer: use tp_channel_get_target_contact()
-rw-r--r--src/empathy-call-observer.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/src/empathy-call-observer.c b/src/empathy-call-observer.c
index 35ceeb046..de21506d5 100644
--- a/src/empathy-call-observer.c
+++ b/src/empathy-call-observer.c
@@ -102,29 +102,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));
@@ -152,21 +139,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)
{