From 9b24a5426278be8cc308190f12944b73c706d101 Mon Sep 17 00:00:00 2001 From: f-r00t Date: Thu, 16 May 2024 20:20:43 +0200 Subject: [PATCH] Tried to fix catastrohpic merge --- src/Database.js | 1 + src/HuginUtilities.js | 37 ------------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/src/Database.js b/src/Database.js index 9f25496..62aac8a 100644 --- a/src/Database.js +++ b/src/Database.js @@ -1515,6 +1515,7 @@ export async function getGroupMessages(group = false, limit = 25) { } console.log(res); return res.reverse(); + } } else { console.log('No message le found!'); } diff --git a/src/HuginUtilities.js b/src/HuginUtilities.js index 6d2f92f..c5bf908 100644 --- a/src/HuginUtilities.js +++ b/src/HuginUtilities.js @@ -140,7 +140,6 @@ export async function getBestCache(onlyOnline = true) { } } -} if (Globals.preferences.cacheEnabled) toastPopUp('No online APIs!'); Globals.APIOnline = false; return false; @@ -775,14 +774,6 @@ export async function sendMessage(message, receiver, messageKey, temp_timestamp) updateMessage(temp_timestamp, 'failed'); } - updateMessage(temp_timestamp, 'sent'); - backgroundSave(); - Globals.lastMessageTimestamp = timestamp; - setLastSyncGroup(timestamp); -} else { - updateMessage(temp_timestamp, 'failed'); -} - Globals.updateMessages(); return result; @@ -994,34 +985,6 @@ export async function getMessage(extra, hash, navigation, fromBackground = false } } - let decryptBox = false; - let createNewPayee = false; - - let key = ''; - - try { - decryptBox = NaclSealed.sealedbox.open(hexToUint(box), - nonceFromTimestamp(timestamp), - getKeyPair().secretKey); - createNewPayee = true; - } catch (err) { - } - if (!decryptBox) { - try { - decryptBox = NaclSealed.sealedbox.open(hexToUint(box), - nonceFromTimestamp(timestamp), - getKeyPairOld().secretKey); - let message_dec_temp = naclUtil.encodeUTF8(decryptBox); - let payload_json_temp = JSON.parse(message_dec_temp); - let from_temp = payload_json_temp.from; - let payee = Globals.payees.filter(item => item.address == from_temp)[0]; - Globals.removePayee(payee.nickname, false); - createNewPayee = true; - } catch (err) { - console.log(err); - } - } - console.log('Thats cool we keep goinbg') let i = 0;