aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-07-20 23:26:30 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-07-20 23:26:30 +0800
commit73a749cafbd78b45494aa5eba645ef2fe9c4e21a (patch)
treee6e17735f1c117203bf934ede853927a05201f92 /libempathy/empathy-tp-chat.c
parentf2e322a3395fc21c533833cd5b9fffb0cc677e3f (diff)
downloadgsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar
gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.gz
gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.bz2
gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.lz
gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.xz
gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.tar.zst
gsoc2013-empathy-73a749cafbd78b45494aa5eba645ef2fe9c4e21a.zip
Initial room list support. It does not works yet.
2007-07-20 Xavier Claessens <xclaesse@gmail.com> * libempathy/Makefile.am: * libempathy/empathy-tp-roomlist.h: * libempathy/empathy-tp-roomlist.c: * libempathy-gtk/empathy-chatrooms-window.c: * libempathy-gtk/empathy-new-chatroom-dialog.c: Initial room list support. It does not works yet. * libempathy-gtk/empathy-account-widget-generic.c: Add support for all types of integer and float. Fixes bug #457740 (Jamey Hicks). * libempathy/empathy-tp-chat.c: * libempathy-gtk/empathy-chat.c: If there is an error sending a message, show an error message to the user. * libempathy-gtk/empathy-accounts-dialog.c: Fix a leak, profile should be unrefed after mc_account_get_profile. * libempathy/empathy-utils.c: * libempathy/empathy-utils.h: * libempathy/empathy-tp-chatroom.c: * libempathy/empathy-tp-group.h: * libempathy/empathy-tp-group.c: * src/empathy.c: Rename empathy_get_channel_id() to empathy_inspect_channel(). We now have empathy_inspect_handle(). * po/POTFILES.in: * libempathy/empathy-tp-contact-list.c: Set all contacts from salut protocol to the "Local Network" group. * libempathy/empathy-idle.c: Fix NetworkManager support. * libempathy/empathy-chatroom.h: Fix indentation. * libempathy-gtk/empathy-status-icon.c: * libempathy-gtk/empathy-ui-utils.c: * libempathy-gtk/empathy-ui-utils.h: - Iconify main window to the status icon like in rhythmbox. Fixes bug #458106 (Jaap A. Haitsma). - Rounded avatars. Fixes bug #457992 (Raphael Slinckx) * Makefile.am: Fix distcheck for gtkdoc (Vincent Untz) * data/empathy.desktop.in.in: Change application description (Jaap A. Haitsma). svn path=/trunk/; revision=190
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r--libempathy/empathy-tp-chat.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index e52b4a086..691d7a2f1 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -88,6 +88,12 @@ static void tp_chat_sent_cb (DBusGProxy
guint message_type,
gchar *message_body,
EmpathyTpChat *chat);
+static void tp_chat_send_error_cb (DBusGProxy *text_iface,
+ guint error_code,
+ guint timestamp,
+ guint message_type,
+ gchar *message_body,
+ EmpathyTpChat *chat);
static void tp_chat_state_changed_cb (DBusGProxy *chat_state_iface,
guint handle,
TelepathyChannelChatState state,
@@ -127,6 +133,7 @@ enum {
enum {
MESSAGE_RECEIVED,
+ SEND_ERROR,
CHAT_STATE_CHANGED,
DESTROY,
LAST_SIGNAL
@@ -291,6 +298,16 @@ empathy_tp_chat_class_init (EmpathyTpChatClass *klass)
G_TYPE_NONE,
1, EMPATHY_TYPE_MESSAGE);
+ signals[SEND_ERROR] =
+ g_signal_new ("send-error",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ empathy_marshal_VOID__OBJECT_UINT,
+ G_TYPE_NONE,
+ 2, EMPATHY_TYPE_MESSAGE, G_TYPE_UINT);
+
signals[CHAT_STATE_CHANGED] =
g_signal_new ("chat-state-changed",
G_TYPE_FROM_CLASS (klass),
@@ -399,6 +416,9 @@ tp_chat_constructor (GType type,
dbus_g_proxy_connect_signal (priv->text_iface, "Sent",
G_CALLBACK (tp_chat_sent_cb),
chat, NULL);
+ dbus_g_proxy_connect_signal (priv->text_iface, "SendError",
+ G_CALLBACK (tp_chat_send_error_cb),
+ chat, NULL);
if (priv->chat_state_iface != NULL) {
dbus_g_proxy_connect_signal (priv->chat_state_iface,
@@ -733,7 +753,7 @@ empathy_tp_chat_get_id (EmpathyTpChat *chat)
return priv->id;
}
- priv->id = empathy_get_channel_id (priv->account, priv->tp_chan);
+ priv->id = empathy_inspect_channel (priv->account, priv->tp_chan);
return priv->id;
}
@@ -770,7 +790,6 @@ tp_chat_closed_cb (TpChan *text_chan,
tp_chat_destroy_cb,
chat);
tp_chat_destroy_cb (text_chan, chat);
-
}
static void
@@ -832,6 +851,29 @@ tp_chat_sent_cb (DBusGProxy *text_iface,
}
static void
+tp_chat_send_error_cb (DBusGProxy *text_iface,
+ guint error_code,
+ guint timestamp,
+ guint message_type,
+ gchar *message_body,
+ EmpathyTpChat *chat)
+{
+ EmpathyMessage *message;
+
+ empathy_debug (DEBUG_DOMAIN, "Message sent error: %s (%d)",
+ message_body, error_code);
+
+ message = tp_chat_build_message (chat,
+ message_type,
+ timestamp,
+ 0,
+ message_body);
+
+ g_signal_emit (chat, signals[SEND_ERROR], 0, message, error_code);
+ g_object_unref (message);
+}
+
+static void
tp_chat_state_changed_cb (DBusGProxy *chat_state_iface,
guint handle,
TelepathyChannelChatState state,