Merge branch 'develop' into party-chat-translations

This commit is contained in:
Mateus Etto
2018-05-19 10:21:54 +09:00
425 changed files with 4415 additions and 4153 deletions

View File

@@ -437,7 +437,11 @@ schema.statics.toJSONCleanChat = async function groupToJSONCleanChat (group, use
// Convert to timestamps because Android expects it
toJSON.chat.forEach(chat => {
chat.timestamp = chat.timestamp ? chat.timestamp.getTime() : new Date().getTime();
// old chats are saved with a numeric timestamp
// new chats use `Date` which then has to be converted to the numeric timestamp
if (chat.timestamp && chat.timestamp.getTime) {
chat.timestamp = chat.timestamp.getTime();
}
});
return toJSON;