</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/empathy/conversation/avatar_in_icon</key>
+ <applyto>/apps/empathy/conversation/avatar_in_icon</applyto>
+ <owner>empathy</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Empathy should use the avatar of the contact as the chat window icon</short>
+ <long>
+ Whether or not Empathy should use the avatar of the contact as the chat window icon.
+ </long>
+ </locale>
+ </schema>
+
<schema>
<key>/schemas/apps/empathy/hints/close_main_window</key>
<applyto>/apps/empathy/hints/close_main_window</applyto>
#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_LANGUAGES EMPATHY_PREFS_PATH "/conversation/spell_checker_languages"
#define EMPATHY_PREFS_CHAT_SPELL_CHECKER_ENABLED EMPATHY_PREFS_PATH "/conversation/spell_checker_enabled"
#define EMPATHY_PREFS_CHAT_NICK_COMPLETION_CHAR EMPATHY_PREFS_PATH "/conversation/nick_completion_char"
+#define EMPATHY_PREFS_CHAT_AVATAR_IN_ICON EMPATHY_PREFS_PATH "/conversation/avatar_in_icon"
#define EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS EMPATHY_PREFS_PATH "/ui/separate_chat_windows"
#define EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN EMPATHY_PREFS_PATH "/ui/main_window_hidden"
#define EMPATHY_PREFS_UI_AVATAR_DIRECTORY EMPATHY_PREFS_PATH "/ui/avatar_directory"
gint page_num;
const gchar *name;
guint n_chats;
+ GdkPixbuf *icon;
+ EmpathyContact *remote_contact;
+ gboolean avatar_in_icon;
/* Get information */
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog),
EMPATHY_IMAGE_MESSAGE);
} else {
- gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
+ empathy_conf_get_bool (empathy_conf_get (),
+ EMPATHY_PREFS_CHAT_AVATAR_IN_ICON,
+ &avatar_in_icon);
+
+ if (n_chats == 1 && avatar_in_icon) {
+ remote_contact = empathy_chat_get_remote_contact (priv->current_chat);
+ icon = empathy_pixbuf_avatar_from_contact_scaled (remote_contact, 0, 0);
+ gtk_window_set_icon (GTK_WINDOW (priv->dialog), icon);
+ g_object_unref (icon);
+ } else {
+ gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
+ }
}
}