diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-15 20:37:53 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-18 19:09:48 +0800 |
commit | fde2bece1e5729ce6907f22a6ae48bb3d1eccab4 (patch) | |
tree | b03fa31c552fc1a51adda23d79cb3073f96b1969 /libempathy | |
parent | c94106860671d6d7d522d93235727e746c10de07 (diff) | |
download | gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.tar gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.tar.gz gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.tar.bz2 gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.tar.lz gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.tar.xz gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.tar.zst gsoc2013-empathy-fde2bece1e5729ce6907f22a6ae48bb3d1eccab4.zip |
use TpTextChannel:message-sent
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-chat.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 440ceda78..b21ebeb1c 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -361,29 +361,28 @@ message_received_cb (TpTextChannel *channel, } static void -tp_chat_sent_cb (TpChannel *channel, - guint timestamp, - guint message_type, - const gchar *message_body, - gpointer user_data, - GObject *chat_) -{ - EmpathyTpChat *chat = EMPATHY_TP_CHAT (chat_); - EmpathyTpChatPriv *priv = GET_PRIV (chat); +message_sent_cb (TpTextChannel *channel, + TpMessage *message, + TpMessageSendingFlags flags, + gchar *token, + EmpathyTpChat *chat) +{ + gchar *message_body; - if (priv->channel == NULL) - return; + message_body = tp_message_to_text (message, NULL); DEBUG ("Message sent: %s", message_body); tp_chat_build_message (chat, FALSE, 0, - message_type, - timestamp, + tp_message_get_message_type (message), + tp_message_get_received_timestamp (message), 0, message_body, 0); + + g_free (message_body); } static void @@ -848,10 +847,9 @@ check_almost_ready (EmpathyTpChat *chat) list_pending_messages (chat); - tp_cli_channel_type_text_connect_to_sent (priv->channel, - tp_chat_sent_cb, - NULL, NULL, - G_OBJECT (chat), NULL); + tp_g_signal_connect_object (priv->channel, "message-sent", + G_CALLBACK (message_sent_cb), chat, 0); + tp_cli_channel_type_text_connect_to_send_error (priv->channel, tp_chat_send_error_cb, NULL, NULL, |