diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-24 23:23:22 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-26 17:55:30 +0800 |
commit | dafe457f2620b7daea7435efa6a9066d53058896 (patch) | |
tree | 37494c03592ac75bc5be19db6ac68aba38241271 | |
parent | 8a962c69bea601023d04ad6e2486115691efee63 (diff) | |
download | gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.tar gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.tar.gz gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.tar.bz2 gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.tar.lz gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.tar.xz gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.tar.zst gsoc2013-empathy-dafe457f2620b7daea7435efa6a9066d53058896.zip |
empathy_dispatcher_chat_with_contact_id(): add optional cb
-rw-r--r-- | libempathy-gtk/empathy-chat.c | 6 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-menu.c | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-new-message-dialog.c | 6 | ||||
-rw-r--r-- | libempathy/empathy-auth-factory.c | 4 | ||||
-rw-r--r-- | libempathy/empathy-dispatcher.c | 24 | ||||
-rw-r--r-- | libempathy/empathy-dispatcher.h | 13 | ||||
-rw-r--r-- | src/empathy-chat-manager.c | 3 | ||||
-rw-r--r-- | src/empathy-chat-window.c | 4 |
8 files changed, 40 insertions, 23 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 1063ad196..43ece8fac 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -258,11 +258,13 @@ account_reconnected (EmpathyChat *chat, if (priv->sms_channel) empathy_dispatcher_sms_contact_id ( account, priv->id, - TP_USER_ACTION_TIME_NOT_USER_ACTION); + TP_USER_ACTION_TIME_NOT_USER_ACTION, + NULL, NULL); else empathy_dispatcher_chat_with_contact_id ( account, priv->id, - TP_USER_ACTION_TIME_NOT_USER_ACTION); + TP_USER_ACTION_TIME_NOT_USER_ACTION, + NULL, NULL); break; case TP_HANDLE_TYPE_ROOM: empathy_dispatcher_join_muc (account, priv->id, diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c index 8b1ed66a7..d65f24ee2 100644 --- a/libempathy-gtk/empathy-individual-menu.c +++ b/libempathy-gtk/empathy-individual-menu.c @@ -566,7 +566,8 @@ empathy_individual_sms_menu_item_activated (GtkMenuItem *item, empathy_dispatcher_sms_contact_id ( empathy_contact_get_account (contact), empathy_contact_get_id (contact), - gtk_get_current_event_time ()); + gtk_get_current_event_time (), + NULL, NULL); } GtkWidget * diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c index 1fe935d4e..2dc5793b4 100644 --- a/libempathy-gtk/empathy-new-message-dialog.c +++ b/libempathy-gtk/empathy-new-message-dialog.c @@ -85,12 +85,14 @@ empathy_new_message_dialog_response (GtkDialog *dialog, int response_id) { case EMP_NEW_MESSAGE_TEXT: empathy_dispatcher_chat_with_contact_id (account, contact_id, - gtk_get_current_event_time ()); + gtk_get_current_event_time (), + NULL, NULL); break; case EMP_NEW_MESSAGE_SMS: empathy_dispatcher_sms_contact_id (account, contact_id, - gtk_get_current_event_time ()); + gtk_get_current_event_time (), + NULL, NULL); break; default: diff --git a/libempathy/empathy-auth-factory.c b/libempathy/empathy-auth-factory.c index 860222605..b98669559 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-dispatcher.c b/libempathy/empathy-dispatcher.c index b1cc1d267..353e94612 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -491,7 +491,7 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact, { empathy_dispatcher_chat_with_contact_id ( empathy_contact_get_account (contact), empathy_contact_get_id (contact), - timestamp); + timestamp, NULL, NULL); } static void @@ -514,7 +514,9 @@ empathy_dispatcher_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; @@ -533,19 +535,23 @@ empathy_dispatcher_create_text_channel (TpAccount *account, req = tp_account_channel_request_new (account, request, timestamp); tp_account_channel_request_ensure_channel_async (req, NULL, NULL, - ensure_text_channel_cb, 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_dispatcher_chat_with_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp) + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data) { empathy_dispatcher_create_text_channel (account, TP_HANDLE_TYPE_CONTACT, - contact_id, FALSE, timestamp); + contact_id, FALSE, timestamp, callback, user_data); } void @@ -554,16 +560,18 @@ empathy_dispatcher_join_muc (TpAccount *account, gint64 timestamp) { empathy_dispatcher_create_text_channel (account, TP_HANDLE_TYPE_ROOM, - room_name, FALSE, timestamp); + room_name, FALSE, timestamp, NULL, NULL); } void empathy_dispatcher_sms_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp) + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data) { empathy_dispatcher_create_text_channel (account, TP_HANDLE_TYPE_CONTACT, - contact_id, TRUE, timestamp); + contact_id, TRUE, timestamp, callback, user_data); } static gboolean diff --git a/libempathy/empathy-dispatcher.h b/libempathy/empathy-dispatcher.h index 19da9dde5..0afd4e53a 100644 --- a/libempathy/empathy-dispatcher.h +++ b/libempathy/empathy-dispatcher.h @@ -60,9 +60,11 @@ GType empathy_dispatcher_get_type (void) G_GNUC_CONST; /* Requesting 1 to 1 text channels */ void empathy_dispatcher_chat_with_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp); + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data); -void empathy_dispatcher_chat_with_contact (EmpathyContact *contact, +void empathy_dispatcher_chat_with_contact (EmpathyContact *contact, gint64 timestamp); /* Request a muc channel */ @@ -70,10 +72,11 @@ void empathy_dispatcher_join_muc (TpAccount *account, const gchar *roomname, gint64 timestamp); -void -empathy_dispatcher_sms_contact_id (TpAccount *account, +void empathy_dispatcher_sms_contact_id (TpAccount *account, const gchar *contact_id, - gint64 timestamp); + gint64 timestamp, + GAsyncReadyCallback callback, + gpointer user_data); void empathy_dispatcher_find_requestable_channel_classes_async (EmpathyDispatcher *dispatcher, TpConnection *connection, diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c index b31684069..219bd87eb 100644 --- a/src/empathy-chat-manager.c +++ b/src/empathy-chat-manager.c @@ -399,7 +399,8 @@ empathy_chat_manager_undo_closed_chat (EmpathyChatManager *self) TP_USER_ACTION_TIME_NOT_USER_ACTION); else empathy_dispatcher_chat_with_contact_id (data->account, data->id, - TP_USER_ACTION_TIME_NOT_USER_ACTION); + TP_USER_ACTION_TIME_NOT_USER_ACTION, + NULL, NULL); g_signal_emit (self, signals[CHATS_CHANGED], 0, g_queue_get_length (priv->queue)); diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 7669c6e7f..bb23e016a 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1828,7 +1828,9 @@ chat_window_drag_data_received (GtkWidget *widget, if (!chat) { empathy_dispatcher_chat_with_contact_id ( - account, contact_id, gtk_get_current_event_time ()); + account, contact_id, + gtk_get_current_event_time (), + NULL, NULL); g_strfreev (strv); return; |