From 173eb2df26ebc15a6aa5565ec15dfad37bfa61a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 22 Jan 2013 10:31:48 +0100 Subject: [PATCH] Only store IDs of Sones in replies. --- src/main/java/net/pterodactylus/sone/core/Core.java | 4 ++-- .../net/pterodactylus/sone/core/SoneDownloader.java | 2 +- .../pterodactylus/sone/data/PostReplyBuilder.java | 2 +- .../net/pterodactylus/sone/data/ReplyBuilder.java | 10 +++++----- .../sone/data/impl/AbstractReplyBuilder.java | 7 +++---- .../data/impl/DefaultPostReplyBuilderFactory.java | 11 +++++++++-- .../sone/data/impl/PostReplyBuilderImpl.java | 15 +++++++++++---- .../pterodactylus/sone/data/impl/PostReplyImpl.java | 12 +++++++----- .../net/pterodactylus/sone/data/impl/ReplyImpl.java | 21 ++++++++++++++------- .../net/pterodactylus/sone/main/SonePlugin.java | 2 ++ 10 files changed, 55 insertions(+), 31 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 8faad72..c3276a3 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1330,7 +1330,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, return; } PostReplyBuilder postReplyBuilder = postReplyBuilderFactory.newPostReplyBuilder(); - postReplyBuilder.withId(replyId).from(sone).to(postId).withTime(replyTime).withText(replyText); + postReplyBuilder.withId(replyId).from(sone.getId()).to(postId).withTime(replyTime).withText(replyText); replies.add(postReplyBuilder.build()); } @@ -1663,7 +1663,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, return null; } PostReplyBuilder postReplyBuilder = postReplyBuilderFactory.newPostReplyBuilder(); - postReplyBuilder.randomId().from(sone).to(post.getId()).currentTime().withText(text.trim()); + postReplyBuilder.randomId().from(sone.getId()).to(post.getId()).currentTime().withText(text.trim()); final PostReply reply = postReplyBuilder.build(); synchronized (replies) { replies.put(reply.getId(), reply); diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java index 6c61fd8..388d804 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloader.java @@ -409,7 +409,7 @@ public class SoneDownloader extends AbstractService { try { PostReplyBuilder postReplyBuilder = core.postReplyBuilder(); /* TODO - parse time correctly. */ - postReplyBuilder.withId(replyId).from(sone).to(replyPostId).withTime(Long.parseLong(replyTime)).withText(replyText); + postReplyBuilder.withId(replyId).from(sone.getId()).to(replyPostId).withTime(Long.parseLong(replyTime)).withText(replyText); replies.add(postReplyBuilder.build()); } catch (NumberFormatException nfe1) { /* TODO - mark Sone as bad. */ diff --git a/src/main/java/net/pterodactylus/sone/data/PostReplyBuilder.java b/src/main/java/net/pterodactylus/sone/data/PostReplyBuilder.java index 1ba7fd5..09eb98a 100644 --- a/src/main/java/net/pterodactylus/sone/data/PostReplyBuilder.java +++ b/src/main/java/net/pterodactylus/sone/data/PostReplyBuilder.java @@ -42,7 +42,7 @@ public interface PostReplyBuilder extends ReplyBuilder { *