From: David ‘Bombe’ Roden Date: Sun, 20 Oct 2013 00:58:03 +0000 (+0200) Subject: Use the given database instead of the core to load images. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3bb7cc80136a57b17998cadcf2f4df668e4f186a;p=Sone.git Use the given database instead of the core to load images. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java index 27348e1..d92527c 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java @@ -207,7 +207,7 @@ public class SoneDownloader extends AbstractService { * if a parse error occurs, or the protocol is invalid */ public Sone parseSone(Sone originalSone, InputStream soneInputStream) throws SoneException { - return new SoneParser(core).parseSone(core.getDatabase(), originalSone, soneInputStream); + return new SoneParser().parseSone(core.getDatabase(), originalSone, soneInputStream); } // diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index 0ca508b..4ce596e 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -61,11 +61,6 @@ public class SoneParser { private static final Logger logger = Logger.getLogger(SoneParser.class.getName()); private static final int MAX_PROTOCOL_VERSION = 0; - private final Core core; - - public SoneParser(Core core) { - this.core = core; - } /** * Parses a Sone from the given input stream and creates a new Sone from the @@ -309,7 +304,7 @@ public class SoneParser { /* process avatar. */ if (avatarId != null) { - profile.setAvatar(core.getImage(avatarId).orNull()); + profile.setAvatar(database.getImage(avatarId).orNull()); } /* okay, apparently everything was parsed correctly. Now import. */