mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
add export_timestamp to chat.json
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user