[polari] room: Base room icon on type rather than group interface



commit ba3307122bbcea08eacb0c6da1dcc0c22b47c59a
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 28 06:12:28 2014 +0100

    room: Base room icon on type rather than group interface
    
    Private chat rooms use an icon to differentiate them from normal group
    chats. Currently we look whether the channel implements the group
    interface to determine whether to show the icon, but as channels
    may come and go nowadays this doesn't work well anymore. Base the
    icon on the (construct-only) type property instead to avoid
    changing the icon based on connectivity.

 src/lib/polari-room.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/lib/polari-room.c b/src/lib/polari-room.c
index cda1208..1004a20 100644
--- a/src/lib/polari-room.c
+++ b/src/lib/polari-room.c
@@ -275,9 +275,7 @@ update_icon (PolariRoom *room)
 
   g_clear_object (&priv->icon);
 
-  if (priv->channel &&
-      !tp_proxy_has_interface_by_id (TP_PROXY (priv->channel),
-                                     TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))
+  if (priv->type == TP_HANDLE_TYPE_CONTACT)
     priv->icon = g_themed_icon_new ("avatar-default-symbolic");
 
   g_object_notify_by_pspec (G_OBJECT (room), props[PROP_ICON]);
@@ -438,7 +436,12 @@ polari_room_set_type (PolariRoom *room,
 
   priv->type = type;
 
+  g_object_freeze_notify (G_OBJECT (room));
+
   g_object_notify_by_pspec (G_OBJECT (room), props[PROP_TYPE]);
+  update_icon (room);
+
+  g_object_thaw_notify (G_OBJECT (room));
 }
 
 static void
@@ -530,7 +533,6 @@ polari_room_set_channel (PolariRoom *room,
   g_object_freeze_notify (G_OBJECT (room));
 
   update_self_nick (room);
-  update_icon (room);
 
   g_object_notify_by_pspec (G_OBJECT (room), props[PROP_CHANNEL]);
 


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