From 22e03050c5a84d7c2fa567821d5d16dec92c4400 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 14 Oct 2010 19:42:44 +0200 Subject: [PATCH] Store more information about the Sone of replies. --- src/main/java/net/pterodactylus/sone/core/Core.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 00dce87..aeb7d4f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -302,7 +302,12 @@ public class Core extends AbstractService { if (replyId == null) { break; } - Sone replySone = soneCache.get(configuration.getStringValue(replyPrefix + "/Sone").getValue(null)); + Sone replySone = soneCache.get(configuration.getStringValue(replyPrefix + "/Sone/ID").getValue(null)); + String replySoneKey = configuration.getStringValue(replyPrefix + "/Sone/Key").getValue(null); + String replySoneName = configuration.getStringValue(replyPrefix + "/Sone/Name").getValue(null); + if (replySone instanceof SoneShell) { + ((SoneShell) replySone).setRequestUri(new FreenetURI(replySoneKey)).setName(replySoneName); + } Post replyPost = postCache.get(configuration.getStringValue(replyPrefix + "/Post").getValue(null)); long replyTime = configuration.getLongValue(replyPrefix + "/Time").getValue(null); String replyText = configuration.getStringValue(replyPrefix + "/Text").getValue(null); @@ -351,7 +356,9 @@ public class Core extends AbstractService { for (Reply reply : sone.getReplies()) { String replyPrefix = sonePrefix + "/Reply." + replyId++; configuration.getStringValue(replyPrefix + "/ID").setValue(reply.getId()); - configuration.getStringValue(replyPrefix + "/Sone").setValue(reply.getSone().getId()); + configuration.getStringValue(replyPrefix + "/Sone/ID").setValue(reply.getSone().getId()); + configuration.getStringValue(replyPrefix + "/Sone/Key").setValue(reply.getSone().getRequestUri().toString()); + configuration.getStringValue(replyPrefix + "/Sone/Name").setValue(reply.getSone().getName()); configuration.getStringValue(replyPrefix + "/Post").setValue(reply.getPost().getId()); configuration.getLongValue(replyPrefix + "/Time").setValue(reply.getTime()); configuration.getStringValue(replyPrefix + "/Text").setValue(reply.getText()); -- 2.7.4