srctree

Robin Linden parent 7ef3c8c4 fc8608ef
Move the contact public key to the top-level object in the chat export

This has the nice side-effect of also including the public key if the chat history is empty.
domain/src/main/kotlin/feature/ExportManager.kt added: 2, removed: 2, total 0
@@ -27,11 +27,11 @@ class ExportManager @Inject constructor(
"timestamp",
SimpleDateFormat("""yyyy-MM-dd'T'HH-mm-ss""", Locale.getDefault()).format(Date()),
)
root.put("contact_public_key", publicKey)
 
val entries = JSONArray()
for (message in messages) {
val jsonMessage = JSONObject().apply {
put("publicKey", message.publicKey)
put("message", message.message)
put("sender", message.sender.toString())
put("type", message.type.toString())