From 812263335baaed451268d1f5bd9432ce37333834 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 1 Dec 2010 08:02:47 +0100 Subject: [PATCH] Prevent posting a message to yourself. --- src/main/java/net/pterodactylus/sone/data/Post.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/data/Post.java b/src/main/java/net/pterodactylus/sone/data/Post.java index 21ba42d..964a054 100644 --- a/src/main/java/net/pterodactylus/sone/data/Post.java +++ b/src/main/java/net/pterodactylus/sone/data/Post.java @@ -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; } -- 2.7.4