aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-22 20:28:47 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-22 20:28:47 +0800
commit83d8dc9899ea0446d682402d2db6355a12be24bc (patch)
tree6e8c3398780c82bd38ded957a3cc9940ed28ce6d
parent52a2f629e73d8d50378530a621469b5e29406742 (diff)
downloadgsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.tar
gsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.tar.gz
gsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.tar.bz2
gsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.tar.lz
gsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.tar.xz
gsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.tar.zst
gsoc2013-empathy-83d8dc9899ea0446d682402d2db6355a12be24bc.zip
Emit "send-error" signal if Send() call fails
svn path=/trunk/; revision=1118
-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));
}