summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-12-15 20:25:02 +0100
committerMattes D <github@xoft.cz>2016-12-16 00:07:23 +0100
commitc7ce9909c86445360c9a2b960cde13d4380679ba (patch)
tree56ca5369d83504ac063dbc3139f72dc2cdf42610
parentInitial support for the 1.11 protocol. (diff)
downloadcuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.tar
cuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.tar.gz
cuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.tar.bz2
cuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.tar.lz
cuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.tar.xz
cuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.tar.zst
cuberite-c7ce9909c86445360c9a2b960cde13d4380679ba.zip
Diffstat (limited to '')
-rw-r--r--src/CompositeChat.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/CompositeChat.cpp b/src/CompositeChat.cpp
index 657d88292..621c871c8 100644
--- a/src/CompositeChat.cpp
+++ b/src/CompositeChat.cpp
@@ -406,7 +406,14 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
msg["extra"].append(Part);
} // for itr - Parts[]
- return msg.toStyledString();
+ #if 1
+ // Serialize as machine-readable string (no whitespace):
+ Json::FastWriter writer;
+ return writer.write(msg);
+ #else
+ // Serialize as human-readable string (pretty-printed):
+ return msg.toStyledString();
+ #endif
}