From: David ‘Bombe’ Roden Date: Wed, 7 Dec 2011 06:22:12 +0000 (+0100) Subject: Load and save avatar. X-Git-Tag: 0.7.6^2~1^2~17 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=4469882d9fe877e817b1be116ab2c6ba0d87aa56 Load and save avatar. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 81c5185..093761e 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1590,6 +1590,12 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis album.addImage(image); } + /* load avatar. */ + String avatarId = configuration.getStringValue(sonePrefix + "/Profile/Avatar").getValue(null); + if (avatarId != null) { + sone.setAvatar(getImage(avatarId, false)); + } + /* load options. */ sone.getOptions().getBooleanOption("AutoFollow").set(configuration.getBooleanValue(sonePrefix + "/Options/AutoFollow").getValue(null)); sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").set(configuration.getBooleanValue(sonePrefix + "/Options/EnableSoneInsertNotifications").getValue(null)); @@ -2135,6 +2141,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis configuration.getIntValue(sonePrefix + "/Profile/BirthDay").setValue(profile.getBirthDay()); configuration.getIntValue(sonePrefix + "/Profile/BirthMonth").setValue(profile.getBirthMonth()); configuration.getIntValue(sonePrefix + "/Profile/BirthYear").setValue(profile.getBirthYear()); + configuration.getStringValue(sonePrefix + "/Profile/Avatar").setValue(sone.getAvatar()); /* save profile fields. */ int fieldCounter = 0;