]> git.0d.be Git - empathy.git/commitdiff
EmpathyChat: tell view to show/hide avatars based on connection interfaces
authorWill Thompson <will.thompson@collabora.co.uk>
Wed, 27 Jun 2012 09:40:52 +0000 (10:40 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 28 Jun 2012 08:56:30 +0000 (10:56 +0200)
I believe that by the time we get here the EmpathyTpChat's TpConnection
should be prepared enough to know its interfaces? It seems to be in my
brief testing.

https://bugzilla.gnome.org/show_bug.cgi?id=627948

libempathy-gtk/empathy-chat.c

index fc2100ba70ce872e20f0033ab3b82f7a0d3fff48..e638bc394035ffe2c03c03b8ef7d1ab9d59b826f 100644 (file)
@@ -3338,6 +3338,17 @@ chat_constructed (GObject *object)
        EmpathyChat *chat = EMPATHY_CHAT (object);
        EmpathyChatPriv *priv = GET_PRIV (chat);
 
+       if (priv->tp_chat != NULL) {
+               TpChannel *channel = TP_CHANNEL (priv->tp_chat);
+               TpConnection *conn = tp_channel_borrow_connection (channel);
+               gboolean supports_avatars =
+                       tp_proxy_has_interface_by_id (conn,
+                                                     TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS);
+
+               empathy_chat_view_set_show_avatars (chat->view,
+                                                   supports_avatars);
+       }
+
        if (priv->handle_type != TP_HANDLE_TYPE_ROOM) {
                /* First display logs from the logger and then display pending messages */
                chat_add_logs (chat);