aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-11 21:53:50 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-25 15:22:41 +0800
commit0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c (patch)
tree22d694d8dce6c66151362c1301e3fa9a6291ff9a /libempathy-gtk
parent4e39c2c5adac55793143c110159fa40cc51f324c (diff)
downloadgsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar
gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.gz
gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.bz2
gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.lz
gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.xz
gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.tar.zst
gsoc2013-empathy-0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c.zip
EmpathyTpChat: inherit from TpTextChannel (#650554)
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c20
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c9
2 files changed, 7 insertions, 22 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 5e1124cdc..ef4d7a53d 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -709,10 +709,8 @@ static gboolean
part_command_supported (EmpathyChat *chat)
{
EmpathyChatPriv * priv = GET_PRIV (chat);
- TpChannel *channel;
- channel = empathy_tp_chat_get_channel (priv->tp_chat);
- return tp_proxy_has_interface_by_id (channel,
+ return tp_proxy_has_interface_by_id (priv->tp_chat,
TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP);
}
@@ -866,14 +864,11 @@ chat_command_me (EmpathyChat *chat,
{
EmpathyChatPriv *priv = GET_PRIV (chat);
TpMessage *message;
- TpChannel *channel;
+ TpTextChannel *channel;
- channel = empathy_tp_chat_get_channel (priv->tp_chat);
+ channel = (TpTextChannel *) (priv->tp_chat);
- /* Strictly speaking we don't depend yet on Messages so best to check that
- * the channel is actually a TpTextChannel before casting it. */
- if (TP_IS_TEXT_CHANNEL (channel) &&
- !tp_text_channel_supports_message_type (TP_TEXT_CHANNEL (channel),
+ if (!tp_text_channel_supports_message_type (channel,
TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION)) {
/* Action message are not supported, 'simulate' the action */
EmpathyContact *self_contact;
@@ -2600,10 +2595,7 @@ chat_remote_contact_changed_cb (EmpathyChat *chat)
priv->handle_type = TP_HANDLE_TYPE_CONTACT;
}
else if (priv->tp_chat != NULL) {
- TpChannel *channel;
-
- channel = empathy_tp_chat_get_channel (priv->tp_chat);
- g_object_get (channel, "handle-type", &priv->handle_type, NULL);
+ tp_channel_get_handle ((TpChannel *) priv->tp_chat, &priv->handle_type);
}
chat_update_contacts_visibility (chat, priv->show_contacts);
@@ -3540,7 +3532,7 @@ display_password_info_bar (EmpathyChat *self)
TRUE, TRUE, 3);
gtk_widget_show_all (hbox);
- tp_g_signal_connect_object (empathy_tp_chat_get_channel (priv->tp_chat),
+ tp_g_signal_connect_object (priv->tp_chat,
"invalidated", G_CALLBACK (chat_invalidated_cb),
info_bar, 0);
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index 783ce77ef..7246ed270 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -233,17 +233,10 @@ contact_list_store_iface_setup (gpointer user_data)
store);
if (EMPATHY_IS_TP_CHAT (priv->list)) {
- TpChannel *channel;
-
- channel = empathy_tp_chat_get_channel (EMPATHY_TP_CHAT (priv->list));
- if (!tp_proxy_is_prepared (channel, TP_CHANNEL_FEATURE_CHAT_STATES)) {
- DEBUG ("Chat state feature not prepared");
- } else {
- g_signal_connect (channel,
+ g_signal_connect (priv->list,
"chat-state-changed",
G_CALLBACK (contact_list_store_chat_state_changed_cb),
store);
- }
}
/* Add contacts already created. */