diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-05-22 20:28:47 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2008-05-22 20:28:47 +0800 |
commit | e35070dd96e1c5c17f29f135771925d4d7fba027 (patch) | |
tree | 6e8c3398780c82bd38ded957a3cc9940ed28ce6d /libempathy/empathy-tp-chat.c | |
parent | 3fbee662dbce6f75e85c39e3dd45019d30cda17e (diff) | |
download | gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.tar gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.tar.gz gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.tar.bz2 gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.tar.lz gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.tar.xz gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.tar.zst gsoc2013-empathy-e35070dd96e1c5c17f29f135771925d4d7fba027.zip |
Emit "send-error" signal if Send() call fails
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1118 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r-- | libempathy/empathy-tp-chat.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 286896bbe..5569ce255 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -447,6 +447,21 @@ tp_chat_send_error_cb (TpChannel *channel, } static void +tp_chat_send_cb (TpChannel *proxy, + const GError *error, + gpointer user_data, + GObject *chat) +{ + EmpathyMessage *message = EMPATHY_MESSAGE (user_data); + + if (error) { + DEBUG ("Error: %s", error->message); + g_signal_emit (chat, signals[SEND_ERROR], 0, message, + TP_CHANNEL_TEXT_SEND_ERROR_UNKNOWN); + } +} + +static void tp_chat_state_changed_cb (TpChannel *channel, guint handle, guint state, @@ -1205,8 +1220,9 @@ empathy_tp_chat_send (EmpathyTpChat *chat, tp_cli_channel_type_text_call_send (priv->channel, -1, message_type, message_body, - tp_chat_async_cb, - "sending message", NULL, + tp_chat_send_cb, + g_object_ref (message), + (GDestroyNotify) g_object_unref, G_OBJECT (chat)); } |