aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2010-06-21 17:33:42 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2010-06-21 17:33:42 +0800
commit44b337df1962dbcda7b8de161444735570d38972 (patch)
treef4d960b0ef300a24e8b79b1cb84418de5f598184 /libempathy
parent783c15aecdb7aba0ef69c4a82dae0f391007185e (diff)
parent733ae445e0f0c79b13de25e408957f23ed9a53a9 (diff)
downloadgsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.tar
gsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.tar.gz
gsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.tar.bz2
gsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.tar.lz
gsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.tar.xz
gsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.tar.zst
gsoc2013-empathy-44b337df1962dbcda7b8de161444735570d38972.zip
Merge remote branch 'sjoerd/misc'
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-contact-list.c6
-rw-r--r--libempathy/empathy-dispatch-operation.c35
2 files changed, 15 insertions, 26 deletions
diff --git a/libempathy/empathy-contact-list.c b/libempathy/empathy-contact-list.c
index 5cbe1cb15..631bb4a37 100644
--- a/libempathy/empathy-contact-list.c
+++ b/libempathy/empathy-contact-list.c
@@ -251,12 +251,10 @@ gboolean
empathy_contact_list_is_favourite (EmpathyContactList *list,
EmpathyContact *contact)
{
-#if HAVE_FAVOURITE_CONTACTS
if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->is_favourite) {
return EMPATHY_CONTACT_LIST_GET_IFACE (list)->is_favourite (
list, contact);
}
-#endif /* HAVE_FAVOURITE_CONTACTS */
return FALSE;
}
@@ -265,22 +263,18 @@ void
empathy_contact_list_add_to_favourites (EmpathyContactList *list,
EmpathyContact *contact)
{
-#if HAVE_FAVOURITE_CONTACTS
if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->add_favourite) {
EMPATHY_CONTACT_LIST_GET_IFACE (list)->add_favourite (list,
contact);
}
-#endif /* HAVE_FAVOURITE_CONTACTS */
}
void
empathy_contact_list_remove_from_favourites (EmpathyContactList *list,
EmpathyContact *contact)
{
-#if HAVE_FAVOURITE_CONTACTS
if (EMPATHY_CONTACT_LIST_GET_IFACE (list)->remove_favourite) {
EMPATHY_CONTACT_LIST_GET_IFACE (list)->remove_favourite (list,
contact);
}
-#endif /* HAVE_FAVOURITE_CONTACTS */
}
diff --git a/libempathy/empathy-dispatch-operation.c b/libempathy/empathy-dispatch-operation.c
index 68777a50e..83cf72483 100644
--- a/libempathy/empathy-dispatch-operation.c
+++ b/libempathy/empathy-dispatch-operation.c
@@ -217,6 +217,7 @@ dispatch_operation_connection_ready (TpConnection *connection,
EmpathyDispatchOperation *self = EMPATHY_DISPATCH_OPERATION (user_data);
EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
TpHandle handle;
+ TpHandleType handle_type;
if (error != NULL)
goto out;
@@ -225,10 +226,18 @@ dispatch_operation_connection_ready (TpConnection *connection,
/* no point to get more information */
goto out;
- handle = tp_channel_get_handle (priv->channel, NULL);
-
- empathy_tp_contact_factory_get_from_handle (priv->connection, handle,
- dispatcher_operation_got_contact_cb, NULL, NULL, G_OBJECT (self));
+ handle = tp_channel_get_handle (priv->channel, &handle_type);
+ if (handle_type == TP_HANDLE_TYPE_CONTACT && priv->contact == NULL)
+ {
+ empathy_tp_contact_factory_get_from_handle (priv->connection, handle,
+ dispatcher_operation_got_contact_cb, NULL, NULL, G_OBJECT (self));
+ }
+ else
+ {
+ g_object_ref (self);
+ tp_channel_call_when_ready (priv->channel,
+ empathy_dispatch_operation_channel_ready_cb, self);
+ }
out:
g_object_unref (self);
@@ -239,8 +248,6 @@ empathy_dispatch_operation_constructed (GObject *object)
{
EmpathyDispatchOperation *self = EMPATHY_DISPATCH_OPERATION (object);
EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
- TpHandle handle;
- TpHandleType handle_type;
empathy_dispatch_operation_set_status (self,
EMPATHY_DISPATCHER_OPERATION_STATE_PREPARING);
@@ -249,21 +256,9 @@ empathy_dispatch_operation_constructed (GObject *object)
g_signal_connect (priv->channel, "invalidated",
G_CALLBACK (empathy_dispatch_operation_invalidated), self);
- handle = tp_channel_get_handle (priv->channel, &handle_type);
-
- if (handle_type == TP_HANDLE_TYPE_CONTACT && priv->contact == NULL)
- {
- /* Ensure to keep the self object alive while the call_when_ready is
- * running */
- g_object_ref (self);
- tp_connection_call_when_ready (priv->connection,
- dispatch_operation_connection_ready, object);
- return;
- }
-
g_object_ref (self);
- tp_channel_call_when_ready (priv->channel,
- empathy_dispatch_operation_channel_ready_cb, self);
+ tp_connection_call_when_ready (priv->connection,
+ dispatch_operation_connection_ready, object);
}
static void