From: David ‘Bombe’ Roden Date: Thu, 17 Jan 2013 11:59:49 +0000 (+0100) Subject: Trim texts of posts and replies before posting. X-Git-Tag: 0.8.5^2~3^2~79 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e0bd82bad92df6e78c510c07c42da099cb50df97;p=Sone.git Trim texts of posts and replies before posting. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 94908cb..7e68521 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1537,7 +1537,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider logger.log(Level.FINE, String.format("Tried to create post for non-local Sone: %s", sone)); return null; } - final Post post = new PostImpl(sone, time, text); + final Post post = new PostImpl(sone, time, text.trim()); if (recipient != null) { post.setRecipient(recipient); } @@ -1679,7 +1679,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider logger.log(Level.FINE, String.format("Tried to create reply for non-local Sone: %s", sone)); return null; } - final PostReply reply = new PostReply(sone, post, System.currentTimeMillis(), text); + final PostReply reply = new PostReply(sone, post, System.currentTimeMillis(), text.trim()); synchronized (replies) { replies.put(reply.getId(), reply); }