From: David ‘Bombe’ Roden Date: Sun, 7 Dec 2014 10:33:16 +0000 (+0100) Subject: Remove post management methods from Sone. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ae7ed7856de14eb339e77ae86e6d4a8b9284162d;p=Sone.git Remove post management methods from Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index c3ac305..2e1b5fb 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -949,7 +949,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, final Post post = postBuilder.build(); database.storePost(post); eventBus.post(new NewPostFoundEvent(post)); - sone.addPost(post); touchConfiguration(); localElementTicker.schedule(new MarkPostKnown(post), 10, TimeUnit.SECONDS); return post; diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 2f529cb..2cf8bf6 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -343,23 +343,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable { List getPosts(); /** - * Adds the given post to this Sone. The post will not be added if its {@link - * Post#getSone() Sone} is not this Sone. - * - * @param post - * The post to add - */ - void addPost(Post post); - - /** - * Removes the given post from this Sone. - * - * @param post - * The post to remove - */ - void removePost(Post post); - - /** * Returns all replies this Sone made. * * @return All replies this Sone made diff --git a/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java b/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java index ce224fd..018ba32 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/IdOnlySone.java @@ -121,14 +121,6 @@ public class IdOnlySone implements Sone { } @Override - public void addPost(Post post) { - } - - @Override - public void removePost(Post post) { - } - - @Override public Set getReplies() { return emptySet(); } diff --git a/src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java b/src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java index eb2fc6e..5d8f1c4 100644 --- a/src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java +++ b/src/main/java/net/pterodactylus/sone/data/impl/SoneImpl.java @@ -363,31 +363,6 @@ public class SoneImpl implements LocalSone { } /** - * Adds the given post to this Sone. The post will not be added if its {@link - * Post#getSone() Sone} is not this Sone. - * - * @param post - * The post to add - */ - public void addPost(Post post) { - if (post.getSone().equals(this) && posts.add(post)) { - logger.log(Level.FINEST, String.format("Adding %s to “%s”.", post, getName())); - } - } - - /** - * Removes the given post from this Sone. - * - * @param post - * The post to remove - */ - public void removePost(Post post) { - if (post.getSone().equals(this)) { - posts.remove(post); - } - } - - /** * Returns all replies this Sone made. * * @return All replies this Sone made