diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-10-14 12:31:16 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-10-14 12:32:13 +0800 |
commit | fecbf935f2b9be2cd6229099334279028fc517f1 (patch) | |
tree | 055bc011da6b83f607016f10e8a5da5d7bc017d6 /libempathy | |
parent | 7b6b8da406493311445f6c2470a005a542972693 (diff) | |
parent | 16e0d5a45bb1e11d57c4d5e512f021ebb6d2da12 (diff) | |
download | gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.tar gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.tar.gz gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.tar.bz2 gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.tar.lz gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.tar.xz gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.tar.zst gsoc2013-empathy-fecbf935f2b9be2cd6229099334279028fc517f1.zip |
Merge remote-tracking branch 'pochu/error-dialog'
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-auth-factory.c | 4 | ||||
-rw-r--r-- | libempathy/empathy-request-util.c | 26 | ||||
-rw-r--r-- | libempathy/empathy-request-util.h | 10 |
3 files changed, 26 insertions, 14 deletions
diff --git a/libempathy/empathy-auth-factory.c b/libempathy/empathy-auth-factory.c index 4eb5134dd..6368b1d7d 100644 --- a/libempathy/empathy-auth-factory.c +++ b/libempathy/empathy-auth-factory.c @@ -20,9 +20,7 @@ #include "empathy-auth-factory.h" -#include <telepathy-glib/interfaces.h> -#include <telepathy-glib/simple-handler.h> -#include <telepathy-glib/util.h> +#include <telepathy-glib/telepathy-glib.h> #define DEBUG_FLAG EMPATHY_DEBUG_TLS #include "empathy-debug.h" diff --git a/libempathy/empathy-request-util.c b/libempathy/empathy-request-util.c index 409fdf54a..6b53dab9a 100644 --- a/libempathy/empathy-request-util.c +++ b/libempathy/empathy-request-util.c @@ -40,7 +40,7 @@ empathy_chat_with_contact (EmpathyContact *contact, { empathy_chat_with_contact_id ( empathy_contact_get_account (contact), empathy_contact_get_id (contact), - timestamp); + timestamp, NULL, NULL); } static void @@ -63,7 +63,9 @@ create_text_channel (TpAccount *account, TpHandleType target_handle_type, const gchar *target_id, gboolean sms_channel, - gint64 timestamp) + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data) { GHashTable *request; TpAccountChannelRequest *req; @@ -83,19 +85,23 @@ create_text_channel (TpAccount *account, tp_account_channel_request_set_delegate_to_preferred_handler (req, TRUE); tp_account_channel_request_ensure_channel_async (req, EMPATHY_CHAT_BUS_NAME, - NULL, ensure_text_channel_cb, NULL); + NULL, callback ? callback : ensure_text_channel_cb, user_data); g_hash_table_unref (request); g_object_unref (req); } +/* @callback is optional, but if it's provided, it should call the right + * _finish() func that we call in ensure_text_channel_cb() */ void empathy_chat_with_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp) + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data) { create_text_channel (account, TP_HANDLE_TYPE_CONTACT, - contact_id, FALSE, timestamp); + contact_id, FALSE, timestamp, callback, user_data); } void @@ -104,14 +110,18 @@ empathy_join_muc (TpAccount *account, gint64 timestamp) { create_text_channel (account, TP_HANDLE_TYPE_ROOM, - room_name, FALSE, timestamp); + room_name, FALSE, timestamp, NULL, NULL); } +/* @callback is optional, but if it's provided, it should call the right + * _finish() func that we call in ensure_text_channel_cb() */ void empathy_sms_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp) + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data) { create_text_channel (account, TP_HANDLE_TYPE_CONTACT, - contact_id, TRUE, timestamp); + contact_id, TRUE, timestamp, callback, user_data); } diff --git a/libempathy/empathy-request-util.h b/libempathy/empathy-request-util.h index 70a607e73..6781b72d4 100644 --- a/libempathy/empathy-request-util.h +++ b/libempathy/empathy-request-util.h @@ -45,9 +45,11 @@ G_BEGIN_DECLS /* Requesting 1 to 1 text channels */ void empathy_chat_with_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp); + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data); -void empathy_chat_with_contact (EmpathyContact *contact, +void empathy_chat_with_contact (EmpathyContact *contact, gint64 timestamp); /* Request a muc channel */ @@ -58,7 +60,9 @@ void empathy_join_muc (TpAccount *account, /* Request a sms channel */ void empathy_sms_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp); + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data); G_END_DECLS |