package net.pterodactylus.fcp;
+import com.google.common.base.Charsets;
+
/**
* The “ModifyPeerNote” command modifies a peer note.
*
*/
public class ModifyPeerNote extends FcpMessage {
+ private static final FreenetBase64 BASE64_ENCODER = new FreenetBase64();
+
public ModifyPeerNote(String identifier, String nodeIdentifier) {
super("ModifyPeerNote");
setField("Identifier", identifier);
@Deprecated
public ModifyPeerNote(String nodeIdentifier, String noteText, int peerNoteType) {
- super("ModifyPeer");
+ super("ModifyPeerNote");
setField("NodeIdentifier", nodeIdentifier);
setField("NoteText", noteText);
setField("PeerNoteType", String.valueOf(peerNoteType));
}
public void setNoteText(String noteText) {
- setField("NoteText", noteText);
+ setField("NoteText", BASE64_ENCODER.encode(noteText.getBytes(Charsets.UTF_8)));
}
public void setPeerNoteType(PeerNoteType peerNoteType) {