X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FAbstractSoneCommand.java;h=33e923372efaca45094612535105b835f59ef86c;hb=e79b0829db2fbfd9f50ad4526c638055b6304429;hp=d71ffc4481125a6327909a0b4199d4b841023dbe;hpb=6f019de1d4d9742981d851ac3c9097cca8bff58e;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java index d71ffc4..33e9233 100644 --- a/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java +++ b/src/main/java/net/pterodactylus/sone/fcp/AbstractSoneCommand.java @@ -1,5 +1,5 @@ /* - * Sone - AbstractSoneCommand.java - Copyright © 2011–2013 David Roden + * Sone - AbstractSoneCommand.java - Copyright © 2011–2016 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,7 +114,7 @@ public abstract class AbstractSoneCommand extends AbstractCommand { * @return The encoded text */ protected static String encodeString(String text) { - return text.replaceAll("\\\\", "\\\\").replaceAll("\n", "\\\\n").replaceAll("\r", "\\\\r"); + return text.replaceAll("\\\\", "\\\\\\\\").replaceAll("\n", "\\\\n").replaceAll("\r", "\\\\r"); } /** @@ -355,7 +355,7 @@ public abstract class AbstractSoneCommand extends AbstractCommand { * {@code null}) * @return The simple field set containing the replies */ - protected static SimpleFieldSet encodeReplies(Collection replies, String prefix) { + protected SimpleFieldSet encodeReplies(Collection replies, String prefix) { SimpleFieldSetBuilder replyBuilder = new SimpleFieldSetBuilder(); int replyIndex = 0; @@ -366,6 +366,7 @@ public abstract class AbstractSoneCommand extends AbstractCommand { replyBuilder.put(replyPrefix + "Sone", reply.getSone().getId()); replyBuilder.put(replyPrefix + "Time", reply.getTime()); replyBuilder.put(replyPrefix + "Text", encodeString(reply.getText())); + replyBuilder.put(encodeLikes(core.getLikes(reply), replyPrefix + "Likes.")); } return replyBuilder.get();