diff --git a/.sync_b2a788d19481.db-shm b/.sync_b2a788d19481.db-shm index 5fe02fd..58083a8 100644 Binary files a/.sync_b2a788d19481.db-shm and b/.sync_b2a788d19481.db-shm differ diff --git a/.sync_b2a788d19481.db-wal b/.sync_b2a788d19481.db-wal index 30a7b88..4b645d5 100644 Binary files a/.sync_b2a788d19481.db-wal and b/.sync_b2a788d19481.db-wal differ diff --git a/assets/js/Q-Mintership.js b/assets/js/Q-Mintership.js index 4da6a66..a69c10c 100644 --- a/assets/js/Q-Mintership.js +++ b/assets/js/Q-Mintership.js @@ -887,6 +887,6 @@ function startPollingForNewMessages() { if (activeRoom) { await loadMessagesFromQDN(activeRoom, currentPage, true); } - }, 20000); + }, 40000); } diff --git a/assets/js/QortalApi.js b/assets/js/QortalApi.js index a6b586c..a8206e7 100644 --- a/assets/js/QortalApi.js +++ b/assets/js/QortalApi.js @@ -797,17 +797,35 @@ async function loadImageHtml(service, name, identifier, filename, mimeType) { const fetchAndSaveAttachment = async (service, name, identifier, filename, mimeType) => { const url = `${baseUrl}/arbitrary/${service}/${name}/${identifier}`; - try { - const response = await fetch(url); - const blob = await response.blob(); - await qortalRequest({ - action: "SAVE_FILE", - blob, - filename: filename, - mimeType - }); - } catch (error) { - console.error("Error fetching or saving the attachment:", error); + if ((service === "FILE_PRIVATE") || (service === "MAIL_PRIVATE")) { + service = "FILE_PRIVATE" || service + try{ + const encryptedBase64Data = await fetchFileBase64(service, name, identifier) + const decryptedBase64 = await decryptObject(encryptedBase64Data) + const fileBlob = new Blob([decryptedBase64], { type: mimeType }); + await qortalRequest({ + action: "SAVE_FILE", + blob: fileBlob, + filename, + mimeType + }); + + }catch (error) { + console.error("Error fetching ro saving encrypted attachment",error) + } + }else{ + try { + const response = await fetch(url); + const blob = await response.blob(); + await qortalRequest({ + action: "SAVE_FILE", + blob, + filename: filename, + mimeType + }); + } catch (error) { + console.error("Error fetching or saving the attachment:", error); + } } }