diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-02-11 21:53:50 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-25 15:22:41 +0800 |
commit | 0dd8e6cbd7b903d2ce8b56995e4b4ac6ed042f2c (patch) | |
tree | 22d694d8dce6c66151362c1301e3fa9a6291ff9a /libempathy/empathy-channel-factory.c | |
parent | 4e39c2c5adac55793143c110159fa40cc51f324c (diff) | |
download | gsoc2013-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/empathy-channel-factory.c')
-rw-r--r-- | libempathy/empathy-channel-factory.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/libempathy/empathy-channel-factory.c b/libempathy/empathy-channel-factory.c index bbe0cb0ba..dec1dfade 100644 --- a/libempathy/empathy-channel-factory.c +++ b/libempathy/empathy-channel-factory.c @@ -21,6 +21,9 @@ #include "empathy-channel-factory.h" +#include "empathy-tp-chat.h" +#include "empathy-utils.h" + #include <telepathy-glib/telepathy-glib.h> static void factory_iface_init (gpointer, gpointer); @@ -98,6 +101,18 @@ empathy_channel_factory_create_channel ( GError **error) { EmpathyChannelFactory *self = (EmpathyChannelFactory *) factory; + const gchar *chan_type; + + chan_type = tp_asv_get_string (properties, TP_PROP_CHANNEL_CHANNEL_TYPE); + + if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT)) + { + TpAccount *account; + + account = empathy_get_account_for_connection (conn); + + return TP_CHANNEL (empathy_tp_chat_new (account, conn, path, properties)); + } return tp_client_channel_factory_create_channel ( self->priv->automatic_factory, conn, path, properties, error); @@ -109,9 +124,19 @@ empathy_channel_factory_dup_channel_features ( TpChannel *channel) { EmpathyChannelFactory *self = (EmpathyChannelFactory *) factory; + GArray *features; + GQuark feature; - return tp_client_channel_factory_dup_channel_features ( + features = tp_client_channel_factory_dup_channel_features ( self->priv->automatic_factory, channel); + + if (EMPATHY_IS_TP_CHAT (channel)) + { + feature = TP_CHANNEL_FEATURE_CHAT_STATES; + g_array_append_val (features, feature); + } + + return features; } static void |