diff --git a/onionr/core.py b/onionr/core.py
index bff27e45..e1f38fa8 100644
--- a/onionr/core.py
+++ b/onionr/core.py
@@ -644,7 +644,7 @@ class Core:
conn.close()
return True
- def insertBlock(self, data, header='txt', sign=False, encryptType='', symKey='', asymPeer='', meta = None):
+ def insertBlock(self, data, header='txt', sign=False, encryptType='', symKey='', asymPeer='', meta = dict()):
'''
Inserts a block into the network
encryptType must be specified to encrypt a block
@@ -663,9 +663,6 @@ class Core:
with open(self.dataNonceFile, 'a') as nonceFile:
nonceFile.write(dataNonce + '\n')
- if meta is None:
- meta = dict()
-
if type(data) is bytes:
data = data.decode()
data = str(data)
diff --git a/onionr/onionrblockapi.py b/onionr/onionrblockapi.py
index 87ca2984..b656bd43 100644
--- a/onionr/onionrblockapi.py
+++ b/onionr/onionrblockapi.py
@@ -163,7 +163,7 @@ class Block:
self.raw = str(blockdata)
self.bheader = json.loads(self.getRaw()[:self.getRaw().index('\n')])
self.bcontent = self.getRaw()[self.getRaw().index('\n') + 1:]
- if self.bheader['encryptType'] in ('asym', 'sym'):
+ if ('encryptType' in self.bheader) and (self.bheader['encryptType'] in ('asym', 'sym')):
self.bmetadata = self.getHeader('meta', None)
self.isEncrypted = True
else:
@@ -193,6 +193,8 @@ class Block:
# if block can't be parsed, it's a waste of precious space. Throw it away.
if not self.delete():
logger.error('Failed to delete invalid block %s.' % self.getHash(), error = e)
+ else:
+ logger.debug('Deleted invalid block %s.' % self.getHash(), timestamp = False)
self.valid = False
return False
@@ -207,7 +209,7 @@ class Block:
if self.exists():
os.remove(self.getBlockFile())
- removeBlock(self.getHash())
+ self.getCore().removeBlock(self.getHash())
return True
return False
@@ -230,7 +232,7 @@ class Block:
blockFile.write(self.getRaw().encode())
self.update()
else:
- self.hash = self.getCore().insertBlock(self.getContent(), header = self.getType(), sign = sign)
+ self.hash = self.getCore().insertBlock(self.getContent(), header = self.getType(), sign = sign, meta = self.getMetadata())
self.update()
return self.getHash()
diff --git a/onionr/static-data/www/ui/common/onionr-timeline-post.html b/onionr/static-data/www/ui/common/onionr-timeline-post.html
index a6873abe..67ec158c 100644
--- a/onionr/static-data/www/ui/common/onionr-timeline-post.html
+++ b/onionr/static-data/www/ui/common/onionr-timeline-post.html
@@ -1,6 +1,6 @@
-
+
@@ -8,8 +8,8 @@
diff --git a/onionr/static-data/www/ui/dist/css/main.css b/onionr/static-data/www/ui/dist/css/main.css
index a69216cb..4b9cfe8d 100644
--- a/onionr/static-data/www/ui/dist/css/main.css
+++ b/onionr/static-data/www/ui/dist/css/main.css
@@ -41,6 +41,8 @@ body {
padding: 1rem;
margin-bottom: 1rem;
+ cursor: pointer;
+
width: 100%;
}
diff --git a/onionr/static-data/www/ui/dist/index.html b/onionr/static-data/www/ui/dist/index.html
index 90f9a30d..080c67eb 100644
--- a/onionr/static-data/www/ui/dist/index.html
+++ b/onionr/static-data/www/ui/dist/index.html
@@ -117,6 +117,20 @@
+
+
+
diff --git a/onionr/static-data/www/ui/dist/js/main.js b/onionr/static-data/www/ui/dist/js/main.js
index 261322eb..77925d91 100644
--- a/onionr/static-data/www/ui/dist/js/main.js
+++ b/onionr/static-data/www/ui/dist/js/main.js
@@ -285,7 +285,7 @@ class Post {
getHTML() {
var postTemplate = '\
\
-
\
+
\
\
\
\
@@ -293,8 +293,8 @@ class Post {
\
\
\
\
\
diff --git a/onionr/static-data/www/ui/dist/js/timeline.js b/onionr/static-data/www/ui/dist/js/timeline.js
index 2712cde8..efb8bb2d 100644
--- a/onionr/static-data/www/ui/dist/js/timeline.js
+++ b/onionr/static-data/www/ui/dist/js/timeline.js
@@ -179,6 +179,12 @@ function makePost() {
}
}
+function focusPost(id) {
+ document.getElementById("onionr-post-focus-content").innerHTML = "";
+
+ jQuery('#onionr-post-focus').modal('show');
+}
+
jQuery('body').on('click', '[data-editable]', function() {
var el = jQuery(this);
var txt = el.text();
@@ -213,6 +219,10 @@ jQuery('body').on('click', '[data-editable]', function() {
input.one('blur', save).bind('keyup', saveEnter).focus();
});
+//viewProfile('$user-id-url', '$user-name-url')
+jQuery('#onionr-post-user-id').on('click', function(e) { alert(3);});
+//jQuery('#onionr-post *').on('click', function(e) { e.stopPropagation(); });
+jQuery('#onionr-post').click(function(e) { alert(1); });
currentUser = getCurrentUser();
if(currentUser !== undefined && currentUser !== null) {
diff --git a/onionr/static-data/www/ui/src/css/main.css b/onionr/static-data/www/ui/src/css/main.css
index a69216cb..4b9cfe8d 100644
--- a/onionr/static-data/www/ui/src/css/main.css
+++ b/onionr/static-data/www/ui/src/css/main.css
@@ -41,6 +41,8 @@ body {
padding: 1rem;
margin-bottom: 1rem;
+ cursor: pointer;
+
width: 100%;
}
diff --git a/onionr/static-data/www/ui/src/index.html b/onionr/static-data/www/ui/src/index.html
index b794a912..b6687779 100644
--- a/onionr/static-data/www/ui/src/index.html
+++ b/onionr/static-data/www/ui/src/index.html
@@ -87,6 +87,20 @@
+
+
+