From d7612089c859f73dbafae2498104cf9329b51e9b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 19 Apr 2010 15:30:23 +0200 Subject: call cb with an error if dispatcher_chat_with_contact* fails --- libempathy/empathy-dispatcher.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libempathy/empathy-dispatcher.c') diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index 8d91928f6..5cff9d842 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -1449,6 +1449,12 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact, if (connection_data == NULL) { /* Connection has been invalidated */ + if (callback != NULL) + { + GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_PROXY_UNREFERENCED, + "Connection has been invalidated" }; + callback (NULL, &error, user_data); + } goto out; } @@ -1485,8 +1491,12 @@ dispatcher_chat_with_contact_id_cb (EmpathyTpContactFactory *factory, if (error) { - /* FIXME: Should call data->callback with the error */ DEBUG ("Error: %s", error->message); + + if (data->callback != NULL) + { + data->callback (NULL, error, data->user_data); + } } else { -- cgit v1.2.3