empathy r1118 - trunk/libempathy



Author: xclaesse
Date: Thu May 22 12:28:47 2008
New Revision: 1118
URL: http://svn.gnome.org/viewvc/empathy?rev=1118&view=rev

Log:
Emit "send-error" signal if Send() call fails


Modified:
   trunk/libempathy/empathy-tp-chat.c

Modified: trunk/libempathy/empathy-tp-chat.c
==============================================================================
--- trunk/libempathy/empathy-tp-chat.c	(original)
+++ trunk/libempathy/empathy-tp-chat.c	Thu May 22 12:28:47 2008
@@ -447,6 +447,21 @@
 }
 
 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 @@
 	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));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]