mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Prettified Code!
This commit is contained in:
parent
285ad3684d
commit
24527e221c
2 changed files with 16 additions and 16 deletions
|
@ -731,7 +731,7 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => {
|
||||||
if (item.fec == "broadcast") {
|
if (item.fec == "broadcast") {
|
||||||
obj.timestamp = Math.floor(Date.now() / 1000);
|
obj.timestamp = Math.floor(Date.now() / 1000);
|
||||||
obj.dxcallsign = item.dxcallsign;
|
obj.dxcallsign = item.dxcallsign;
|
||||||
obj.dxgrid = 'null';
|
obj.dxgrid = "null";
|
||||||
obj.uuid = uuidv4().toString();
|
obj.uuid = uuidv4().toString();
|
||||||
obj.command = "msg";
|
obj.command = "msg";
|
||||||
obj.checksum = "null";
|
obj.checksum = "null";
|
||||||
|
@ -742,11 +742,11 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => {
|
||||||
obj.filename = "null";
|
obj.filename = "null";
|
||||||
obj.filetype = "null";
|
obj.filetype = "null";
|
||||||
obj.file = "null";
|
obj.file = "null";
|
||||||
console.log(obj)
|
console.log(obj);
|
||||||
add_obj_to_database(obj);
|
add_obj_to_database(obj);
|
||||||
update_chat_obj_by_uuid(obj.uuid);
|
update_chat_obj_by_uuid(obj.uuid);
|
||||||
|
|
||||||
//handle ping
|
//handle ping
|
||||||
} else if (item.ping == "received") {
|
} else if (item.ping == "received") {
|
||||||
obj.timestamp = parseInt(item.timestamp);
|
obj.timestamp = parseInt(item.timestamp);
|
||||||
obj.dxcallsign = item.dxcallsign;
|
obj.dxcallsign = item.dxcallsign;
|
||||||
|
|
26
gui/sock.js
26
gui/sock.js
|
@ -243,21 +243,21 @@ client.on("data", function (socketdata) {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "broadcast":
|
case "broadcast":
|
||||||
// RX'd FEC BROADCAST
|
// RX'd FEC BROADCAST
|
||||||
var encoded_data = FD.atob_FD(data["data"]);
|
var encoded_data = FD.atob_FD(data["data"]);
|
||||||
var splitted_data = encoded_data.split(split_char);
|
var splitted_data = encoded_data.split(split_char);
|
||||||
var messageArray = [];
|
var messageArray = [];
|
||||||
if (splitted_data[0] == "m") {
|
if (splitted_data[0] == "m") {
|
||||||
messageArray.push(data);
|
messageArray.push(data);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
let Messages = {
|
let Messages = {
|
||||||
data: messageArray,
|
data: messageArray,
|
||||||
};
|
};
|
||||||
ipcRenderer.send("request-new-msg-received", Messages);
|
ipcRenderer.send("request-new-msg-received", Messages);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (data["cq"]) {
|
switch (data["cq"]) {
|
||||||
|
|
Loading…
Reference in a new issue