From 156dcb1729b154faa5630c3b3e66644f4178b556 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 12 Feb 2019 15:39:51 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20check=20for=20non-existing=20Son?= =?utf8?q?e-following=20times=20on=20your=20own=20posts/replies?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/core/Core.java | 8 ++++++-- 1 file changed, 6 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 1601606..4319d8b 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -859,7 +859,9 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, soneChangeDetector.onNewPosts(new PostProcessor() { @Override public void processPost(Post post) { - if (post.getTime() < database.getFollowingTime(newSone.getId())) { + if (post.getSone().equals(newSone)) { + post.setKnown(true); + } else if (post.getTime() < database.getFollowingTime(newSone.getId())) { post.setKnown(true); } else if (!post.isKnown()) { events.add(new NewPostFoundEvent(post)); @@ -875,7 +877,9 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, soneChangeDetector.onNewPostReplies(new PostReplyProcessor() { @Override public void processPostReply(PostReply postReply) { - if (postReply.getTime() < database.getFollowingTime(newSone.getId())) { + if (postReply.getSone().equals(newSone)) { + postReply.setKnown(true); + } else if (postReply.getTime() < database.getFollowingTime(newSone.getId())) { postReply.setKnown(true); } else if (!postReply.isKnown()) { events.add(new NewPostReplyFoundEvent(postReply)); -- 2.7.4