mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
changing split char and split char order
This commit is contained in:
parent
f2e5a11348
commit
37267ac679
2 changed files with 8 additions and 8 deletions
|
@ -325,7 +325,7 @@ db.post({
|
||||||
|
|
||||||
var file_checksum = crc32(file).toString(16).toUpperCase();
|
var file_checksum = crc32(file).toString(16).toUpperCase();
|
||||||
console.log(file_checksum)
|
console.log(file_checksum)
|
||||||
var data_with_attachment = chatmessage + split_char + filename + split_char + filetype + split_char + timstamp + split_char + file;
|
var data_with_attachment = timestamp + split_char + chatmessage + split_char + filename + split_char + filetype + split_char + file;
|
||||||
|
|
||||||
document.getElementById('selectFilesButton').innerHTML = ``;
|
document.getElementById('selectFilesButton').innerHTML = ``;
|
||||||
var uuid = uuidv4();
|
var uuid = uuidv4();
|
||||||
|
@ -476,20 +476,20 @@ ipcRenderer.on('action-new-msg-received', (event, arg) => {
|
||||||
|
|
||||||
console.log(splitted_data)
|
console.log(splitted_data)
|
||||||
|
|
||||||
obj.timestamp = parseInt(splitted_data[8]);
|
obj.timestamp = parseInt(splitted_data[4]);
|
||||||
obj.dxcallsign = item.dxcallsign;
|
obj.dxcallsign = item.dxcallsign;
|
||||||
obj.dxgrid = item.dxgrid;
|
obj.dxgrid = item.dxgrid;
|
||||||
obj.command = splitted_data[1];
|
obj.command = splitted_data[1];
|
||||||
obj.checksum = splitted_data[2];
|
obj.checksum = splitted_data[2];
|
||||||
// convert message to unicode from utf8 because of emojis
|
// convert message to unicode from utf8 because of emojis
|
||||||
obj.uuid = utf8.decode(splitted_data[3]);
|
obj.uuid = utf8.decode(splitted_data[3]);
|
||||||
obj.msg = utf8.decode(splitted_data[4]);
|
obj.msg = utf8.decode(splitted_data[5]);
|
||||||
obj.status = 'null';
|
obj.status = 'null';
|
||||||
obj.snr = 'null';
|
obj.snr = 'null';
|
||||||
obj.type = 'received';
|
obj.type = 'received';
|
||||||
obj.filename = utf8.decode(splitted_data[5]);
|
obj.filename = utf8.decode(splitted_data[6]);
|
||||||
obj.filetype = utf8.decode(splitted_data[6]);
|
obj.filetype = utf8.decode(splitted_data[7]);
|
||||||
obj.file = btoa(utf8.decode(splitted_data[7]));
|
obj.file = btoa(utf8.decode(splitted_data[8]));
|
||||||
|
|
||||||
add_obj_to_database(obj);
|
add_obj_to_database(obj);
|
||||||
update_chat_obj_by_uuid(obj.uuid);
|
update_chat_obj_by_uuid(obj.uuid);
|
||||||
|
@ -866,7 +866,7 @@ update_chat = function(obj) {
|
||||||
console.log(binaryString)
|
console.log(binaryString)
|
||||||
console.log(binaryString.length)
|
console.log(binaryString.length)
|
||||||
|
|
||||||
var data_with_attachment = utf8.encode(doc.msg) + split_char + filename + split_char + filetype + split_char + doc.timestamp + split_char + binaryString;
|
var data_with_attachment = doc.timestamp + split_char + utf8.encode(doc.msg) + split_char + filename + split_char + filetype + split_char + binaryString;
|
||||||
let Data = {
|
let Data = {
|
||||||
command: "send_message",
|
command: "send_message",
|
||||||
dxcallsign: doc.dxcallsign,
|
dxcallsign: doc.dxcallsign,
|
||||||
|
|
|
@ -3116,7 +3116,7 @@ class DATA:
|
||||||
data = decoded_data[8]
|
data = decoded_data[8]
|
||||||
else:
|
else:
|
||||||
message = b''
|
message = b''
|
||||||
filename = b'reveived'
|
filename = b''
|
||||||
|
|
||||||
# save file to folder
|
# save file to folder
|
||||||
if filename not in [b'', b'undefined']:
|
if filename not in [b'', b'undefined']:
|
||||||
|
|
Loading…
Reference in a new issue