aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-event-manager.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-03-04 18:41:28 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-04-22 18:21:13 +0800
commit9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5 (patch)
tree78925c31878880bc82163cb02e9e38e7fe0679cf /src/empathy-event-manager.c
parentdcd115814f40de200c3cf4da6693de84489592ac (diff)
downloadgsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar
gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.gz
gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.bz2
gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.lz
gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.xz
gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.tar.zst
gsoc2013-empathy-9b9fcd3ce3b9c7fdc62836821d83377bec58d0a5.zip
Change EmpathyTpContactFactory API to look more like TpConnection. Add function to get only one contact from
id/handle.
Diffstat (limited to 'src/empathy-event-manager.c')
-rw-r--r--src/empathy-event-manager.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 4efb7078e..7d8721c3e 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -589,14 +589,22 @@ event_manager_tube_dispatch_ability_cb (GObject *object,
static void
event_manager_tube_got_contact_cb (EmpathyTpContactFactory *factory,
- GList *contacts,
+ EmpathyContact *contact,
+ const GError *error,
gpointer user_data,
GObject *object)
{
EventManagerApproval *approval = (EventManagerApproval *)user_data;
EmpathyTubeDispatchAbility dispatchability;
- approval->contact = g_object_ref (contacts->data);
+ if (error != NULL)
+ {
+ /* FIXME: We should probably still display the event */
+ DEBUG ("Error: %s", error->message);
+ return;
+ }
+
+ approval->contact = g_object_ref (contact);
dispatchability = empathy_tube_dispatch_is_dispatchable
(approval->tube_dispatch);
@@ -705,7 +713,8 @@ event_room_channel_process_func (EventPriv *event)
static void
event_manager_muc_invite_got_contact_cb (EmpathyTpContactFactory *factory,
- GList *contacts,
+ EmpathyContact *contact,
+ const GError *error,
gpointer user_data,
GObject *object)
{
@@ -715,7 +724,14 @@ event_manager_muc_invite_got_contact_cb (EmpathyTpContactFactory *factory,
gchar *msg;
TpHandle self_handle;
- approval->contact = g_object_ref (contacts->data);
+ if (error != NULL)
+ {
+ /* FIXME: We should probably still display the event */
+ DEBUG ("Error: %s", error->message);
+ return;
+ }
+
+ approval->contact = g_object_ref (contact);
channel = empathy_dispatch_operation_get_channel (approval->operation);
self_handle = tp_channel_group_get_self_handle (channel);
@@ -785,8 +801,8 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
connection = empathy_tp_chat_get_connection (tp_chat);
factory = empathy_tp_contact_factory_dup_singleton (connection);
- empathy_tp_contact_factory_get_from_handles (factory,
- 1, &inviter, event_manager_muc_invite_got_contact_cb,
+ empathy_tp_contact_factory_get_from_handle (factory,
+ inviter, event_manager_muc_invite_got_contact_cb,
approval, NULL, G_OBJECT (manager));
g_object_unref (factory);
@@ -861,7 +877,7 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
approval->tube_dispatch = empathy_tube_dispatch_new (operation);
connection = tp_channel_borrow_connection (channel);
factory = empathy_tp_contact_factory_dup_singleton (connection);
- empathy_tp_contact_factory_get_from_handles (factory, 1, &handle,
+ empathy_tp_contact_factory_get_from_handle (factory, handle,
event_manager_tube_got_contact_cb, approval, NULL, G_OBJECT (manager));
}
else