mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted receiving of new message
This commit is contained in:
parent
219f53208d
commit
cae51b2ad4
|
@ -422,17 +422,26 @@ function addObjToDatabase(newobj) {
|
|||
// handle response
|
||||
console.log("new database entry");
|
||||
console.log(response);
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
console.log(newobj);
|
||||
|
||||
if (newobj.command === "msg") {
|
||||
chat.unsorted_chat_list.push(newobj);
|
||||
chat.sorted_chat_list = sortChatList();
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.log(err);
|
||||
console.log(newobj);
|
||||
|
||||
// try upserting status in case we tried sending a message to our selfes
|
||||
databaseUpsert(newobj.uuid, "status", newobj.status);
|
||||
updateUnsortedChatListEntry(newobj.uuid, "status", newobj.status);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
// upsert footer ...
|
||||
|
||||
|
@ -461,6 +470,9 @@ function createChatIndex() {
|
|||
"bytesperminute",
|
||||
"_attachments",
|
||||
"is_new",
|
||||
"nacks",
|
||||
"duration",
|
||||
"speed_list"
|
||||
],
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue