Fix colons hiding in group chats. Fix jsonl chat imports hanging

This commit is contained in:
SillyLossy
2023-05-01 21:03:16 +03:00
parent 1fe0310de3
commit c4434c3747
2 changed files with 6 additions and 9 deletions

View File

@@ -1618,7 +1618,7 @@ app.post("/importchat", urlencodedParser, function (request, response) {
rl.once('line', (line) => {
let jsonData = json5.parse(line);
if (jsonData.user_name !== undefined) {
if (jsonData.user_name !== undefined || jsonData.name !== undefined) {
//console.log(humanizedISO8601DateTime()+':/importchat copying chat as '+ch_name+' - '+humanizedISO8601DateTime()+'.jsonl');
fs.copyFile('./uploads/' + filedata.filename, chatsPath + avatar_url + '/' + ch_name + ' - ' + humanizedISO8601DateTime() + '.jsonl', (err) => { //added character name and replaced Date.now() with humanizedISO8601DateTime
if (err) {
@@ -1630,7 +1630,7 @@ app.post("/importchat", urlencodedParser, function (request, response) {
}
});
} else {
//response.send({error:true});
response.send({error:true});
return;
}
rl.close();