summaryrefslogtreecommitdiffstats
path: root/src/CompositeChat.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-12-16 00:28:12 +0100
committerGitHub <noreply@github.com>2016-12-16 00:28:12 +0100
commit71e14ee358e59314498e9b46484eff7e34ae6442 (patch)
tree56ca5369d83504ac063dbc3139f72dc2cdf42610 /src/CompositeChat.cpp
parentAPIDump: Load the official undocumented from alternate location. (diff)
parentCompositeChat: Use shorter JSON format. (diff)
downloadcuberite-71e14ee358e59314498e9b46484eff7e34ae6442.tar
cuberite-71e14ee358e59314498e9b46484eff7e34ae6442.tar.gz
cuberite-71e14ee358e59314498e9b46484eff7e34ae6442.tar.bz2
cuberite-71e14ee358e59314498e9b46484eff7e34ae6442.tar.lz
cuberite-71e14ee358e59314498e9b46484eff7e34ae6442.tar.xz
cuberite-71e14ee358e59314498e9b46484eff7e34ae6442.tar.zst
cuberite-71e14ee358e59314498e9b46484eff7e34ae6442.zip
Diffstat (limited to 'src/CompositeChat.cpp')
-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
}