]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-theme-boxes.c
Merge branch 'sasl'
[empathy.git] / libempathy-gtk / empathy-theme-boxes.c
index 531f2baa6a109a5d7f76dc875a7721d66ea21356..bf97f3f97dcdebf5fcc6b2f74fd4d7b7e9254ec2 100644 (file)
@@ -106,7 +106,7 @@ theme_boxes_pad_to_size (GdkPixbuf *pixbuf,
 
 typedef struct {
        GdkPixbuf *pixbuf;
-       gchar     *token;
+       gchar     *filename;
 } AvatarData;
 
 static void
@@ -115,7 +115,7 @@ theme_boxes_avatar_cache_data_free (gpointer ptr)
        AvatarData *data = ptr;
 
        g_object_unref (data->pixbuf);
-       g_free (data->token);
+       g_free (data->filename);
        g_slice_free (AvatarData, data);
 }
 
@@ -131,7 +131,7 @@ theme_boxes_get_avatar_pixbuf_with_cache (EmpathyContact *contact)
        avatar = empathy_contact_get_avatar (contact);
        data = g_object_get_data (G_OBJECT (contact), "chat-view-avatar-cache");
        if (data) {
-               if (avatar && !tp_strdiff (avatar->token, data->token)) {
+               if (avatar && !tp_strdiff (avatar->filename, data->filename)) {
                        /* We have the avatar in cache */
                        return data->pixbuf;
                }
@@ -147,9 +147,11 @@ theme_boxes_get_avatar_pixbuf_with_cache (EmpathyContact *contact)
                return NULL;
        }
 
-       /* Insert new pixbuf in cache */
+       /* Insert new pixbuf in cache. We store the filename as it's unique
+        * for each version of an avatar, so we can use it to perform change
+        * detection (as above). */
        data = g_slice_new0 (AvatarData);
-       data->token = g_strdup (avatar->token);
+       data->filename = g_strdup (avatar->filename);
        data->pixbuf = pixbuf;
 
        g_object_set_data_full (G_OBJECT (contact), "chat-view-avatar-cache",
@@ -204,7 +206,7 @@ theme_boxes_maybe_append_header (EmpathyThemeBoxes *theme,
        gboolean              consecutive;
 
        contact = empathy_message_get_sender (msg);
-       name = empathy_contact_get_name (contact);
+       name = empathy_contact_get_alias (contact);
        last_contact = empathy_chat_text_view_get_last_contact (view);
        buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (theme));
        time_ = empathy_message_get_timestamp (msg);
@@ -347,7 +349,7 @@ theme_boxes_append_message (EmpathyChatTextView *view,
                gchar *body;
 
                body = g_strdup_printf (" * %s %s",
-                                       empathy_contact_get_name (sender),
+                                       empathy_contact_get_alias (sender),
                                        empathy_message_get_body (message));
                empathy_chat_text_view_append_body (EMPATHY_CHAT_TEXT_VIEW (view),
                                                    body,