From: David ‘Bombe’ Roden Date: Tue, 12 Feb 2019 14:39:51 +0000 (+0100) Subject: Don’t check for non-existing Sone-following times on your own posts/replies X-Git-Tag: v79^2~116 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=156dcb1729b154faa5630c3b3e66644f4178b556;p=Sone.git Don’t check for non-existing Sone-following times on your own posts/replies --- 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));