changeset 5900:faf4363e56a8

[gaim-migrate @ 6332] If you set your buddy icon and you have yourself added to your own list on that same account, your icon will automatically update. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 15 Jun 2003 20:13:48 +0000
parents 349204c9a709
children 74e273e22f94
files src/gtkaccount.c
diffstat 1 files changed, 26 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkaccount.c	Sun Jun 15 20:12:05 2003 +0000
+++ b/src/gtkaccount.c	Sun Jun 15 20:13:48 2003 +0000
@@ -214,8 +214,33 @@
 {
 	const char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog->buddy_icon_filesel));
 
-	if (dialog->account)
+	if (dialog->account) {
+		const char *username;
+		struct buddy *b;
+
 		gaim_account_set_buddy_icon(dialog->account, filename);
+
+		username = gaim_account_get_username(dialog->account);
+
+		b = gaim_find_buddy(dialog->account, username);
+
+		if (b != NULL) {
+			GaimConversation *conv;
+
+			gaim_buddy_set_setting(b, "buddy_icon", filename);
+			gaim_blist_save();
+			gaim_blist_update_buddy_icon(b);
+
+			conv = gaim_find_conversation(username);
+
+			if (conv != NULL &&
+				gaim_conversation_get_account(conv) == dialog->account) {
+
+				gaim_gtkconv_update_buddy_icon(conv);
+			}
+		}
+	}
+
 	gtk_entry_set_text(GTK_ENTRY(dialog->buddy_icon_entry), filename);
 	gtk_widget_destroy(dialog->buddy_icon_filesel);
 }