aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-05-22 20:28:47 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-05-22 20:28:47 +0800
commite35070dd96e1c5c17f29f135771925d4d7fba027 (patch)
tree6e8c3398780c82bd38ded957a3cc9940ed28ce6d /libempathy/empathy-tp-chat.c
parent3fbee662dbce6f75e85c39e3dd45019d30cda17e (diff)
downloadgsoc2013-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.c20
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));
}