From e33bca287a6c8ee97b6d9772e78db0ee0dab2736 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 12 Jul 2019 13:43:18 +0100 Subject: [PATCH] Likes and replies within object --- posts.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/posts.py b/posts.py index aa40ae9a6..d29193865 100644 --- a/posts.py +++ b/posts.py @@ -849,10 +849,14 @@ def createBoxBase(baseDir: str,boxname: str, \ # get the post as json with open(filePath, 'r') as fp: p=commentjson.load(fp) - # Don't show likes to unauthorized viewers + # Don't show likes or replies to unauthorized viewers if not authorized: - if p.get('likes'): - p['likes']={} + if p.get('object'): + if isinstance(p['object'], dict): + if p['object'].get('likes'): + p['likes']={} + if p['object'].get('replies'): + p['replies']={} # insert it into the box feed if postsOnPageCtr < itemsPerPage: if not headerOnly: