'), terminal=True)
@@ -70,6 +76,9 @@ def get_file():
logger.error('Block hash is invalid', terminal=True)
return
- with open(fileName, 'wb') as myFile:
- myFile.write(base64.b64decode(Block(bHash).bcontent))
+ try:
+ with open(fileName, 'wb') as myFile:
+ myFile.write(base64.b64decode(Block(bHash).bcontent))
+ except onionrexceptions.NoDataAvailable:
+ logger.error('That block is not available. Trying again later may work.', terminal=True)
return
\ No newline at end of file
diff --git a/onionr/onionrcommands/softreset.py b/onionr/onionrcommands/softreset.py
index 4dfcb273..68f5f96e 100644
--- a/onionr/onionrcommands/softreset.py
+++ b/onionr/onionrcommands/softreset.py
@@ -31,6 +31,7 @@ def soft_reset():
path = filepaths.block_data_location
shutil.rmtree(path)
os.remove(dbfiles.block_meta_db)
+ os.remove(filepaths.upload_list)
logger.info("Soft reset Onionr", terminal=True)
soft_reset.onionr_help = "Deletes Onionr blocks and their associated metadata, except for any exported block files."
\ No newline at end of file
diff --git a/onionr/onionrcrypto/signing/__init__.py b/onionr/onionrcrypto/signing/__init__.py
index a62f5ba9..3562efe0 100644
--- a/onionr/onionrcrypto/signing/__init__.py
+++ b/onionr/onionrcrypto/signing/__init__.py
@@ -4,6 +4,7 @@ import unpaddedbase32
import nacl.encoding, nacl.signing, nacl.exceptions
from onionrutils import bytesconverter
+from onionrutils import mnemonickeys
import logger
def ed_sign(data, key, encodeResult=False):
'''Ed25519 sign data'''
diff --git a/onionr/static-data/www/mail/index.html b/onionr/static-data/www/mail/index.html
index cf04e60d..c1802a77 100755
--- a/onionr/static-data/www/mail/index.html
+++ b/onionr/static-data/www/mail/index.html
@@ -59,7 +59,7 @@
Mail
- Send email style messages
+ Private and safe messages
diff --git a/onionr/static-data/www/mail/mail.js b/onionr/static-data/www/mail/mail.js
index 29870051..9d1ac19b 100755
--- a/onionr/static-data/www/mail/mail.js
+++ b/onionr/static-data/www/mail/mail.js
@@ -26,6 +26,7 @@ threadContent = {}
replyBtn = document.getElementById('replyBtn')
addUnknownContact = document.getElementById('addUnknownContact')
noInbox = document.getElementById('noInbox')
+humanReadableCache = {}
function addContact(pubkey, friendName){
fetch('/friends/add/' + pubkey, {
@@ -61,7 +62,14 @@ function openReply(bHash, quote, subject){
for (var x = 0; x < splitQuotes.length; x++){
splitQuotes[x] = '> ' + splitQuotes[x]
}
- quote = '\n' + key.substring(0, 12) + ' wrote:' + '\n' + splitQuotes.join('\n')
+
+ if (typeof humanReadableCache[key] != 'undefined'){
+ document.getElementById('draftID').value = humanReadableCache[key]
+ quote = '\n' + humanReadableCache[key].split(' ').slice(0,3).join(' ') + ' wrote:\n' + splitQuotes.join('\n')
+ }
+ else{
+ quote = '\n' + key.substring(0, 12) + ' wrote:' + '\n' + splitQuotes.join('\n')
+ }
document.getElementById('draftText').value = quote
setActiveTab('compose')
}
@@ -184,6 +192,7 @@ function loadInboxEntries(bHash){
entry.setAttribute('data-nameSet', false)
}
else{
+ loadHumanReadableToCache(resp['meta']['signer'])
senderInput.value = name
entry.setAttribute('data-nameSet', true)
}
@@ -295,6 +304,7 @@ function getSentbox(){
sentDate.innerText = humanDate.substring(0, humanDate.indexOf('('))
if (resp[i]['name'] == null || resp[i]['name'].toLowerCase() == 'anonymous'){
toEl.value = resp[i]['peer']
+ setHumanReadableValue(toEl, resp[i]['peer'])
}
else{
toEl.value = resp[i]['name']
diff --git a/onionr/static-data/www/mail/sethumanreadable.js b/onionr/static-data/www/mail/sethumanreadable.js
index 83279acd..24e72428 100644
--- a/onionr/static-data/www/mail/sethumanreadable.js
+++ b/onionr/static-data/www/mail/sethumanreadable.js
@@ -1,10 +1,21 @@
-function setHumanReadableValue(el, key){
+function loadHumanReadableToCache(key){
fetch('/getHumanReadable/' + key, {
headers: {
"token": webpass
}})
.then((resp) => resp.text())
.then(function(resp) {
- el.value = resp
+ humanReadableCache[key] = resp
})
+}
+
+function setHumanReadableValue(el, key){
+ if (typeof humanReadableCache[key] != 'undefined'){
+ el.value = humanReadableCache[key]
+ return
+ }
+ else{
+ setTimeout(function(){setHumanReadableValue(el, key)})
+ return
+ }
}
\ No newline at end of file