add export_timestamp to chat.json

This commit is contained in:
Simon Laux
2020-11-25 21:11:36 +01:00
parent 584d28f807
commit b8cbcc6648

View File

@@ -27,6 +27,7 @@ use crate::contact::*;
use crate::context::Context; use crate::context::Context;
// use crate::error::Error; // use crate::error::Error;
use crate::message::*; use crate::message::*;
use crate::dc_tools::time;
use std::collections::HashMap; use std::collections::HashMap;
use std::fs::File; use std::fs::File;
use std::io::prelude::*; use std::io::prelude::*;
@@ -103,6 +104,7 @@ fn pack_exported_chat(
#[derive(Serialize)] #[derive(Serialize)]
struct ChatJSON { struct ChatJSON {
chat_json_version: u8, chat_json_version: u8,
export_timestamp: i64,
name: String, name: String,
color: String, color: String,
profile_img: Option<String>, profile_img: Option<String>,
@@ -290,6 +292,7 @@ async fn export_chat_data(context: &Context, chat_id: ChatId) -> ExportChatResul
let chat_json = ChatJSON { let chat_json = ChatJSON {
chat_json_version: 1, chat_json_version: 1,
export_timestamp: time(),
name: chat.get_name().to_owned(), name: chat.get_name().to_owned(),
color: format!("{:#}", chat.get_color(&context).await), color: format!("{:#}", chat.get_color(&context).await),
profile_img: chat_avatar, profile_img: chat_avatar,