Prevent posting a message to yourself.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 1 Dec 2010 07:02:47 +0000 (08:02 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 1 Dec 2010 07:02:47 +0000 (08:02 +0100)
src/main/java/net/pterodactylus/sone/data/Post.java

index 21ba42d..964a054 100644 (file)
@@ -159,7 +159,9 @@ public class Post {
         * @return This post (for method chaining)
         */
        public Post setRecipient(Sone recipient) {
-               this.recipient = recipient;
+               if (!sone.equals(recipient)) {
+                       this.recipient = recipient;
+               }
                return this;
        }