Less indentation

main
Bob Mottram 2021-07-05 11:22:23 +01:00
parent 2099788bcd
commit cd14cc2775
1 changed files with 48 additions and 45 deletions

View File

@ -1800,6 +1800,7 @@ def searchBoxPosts(baseDir: str, nickname: str, domain: str,
containing matching strings
"""
path = baseDir + '/accounts/' + nickname + '@' + domain + '/' + boxName
# is this a virtual box, such as direct messages?
if not os.path.isdir(path):
if os.path.isfile(path + '.index'):
return _searchVirtualBoxPosts(baseDir, nickname, domain,
@ -1854,7 +1855,8 @@ def undoLikesCollectionEntry(recentPostsCache: {},
"""Undoes a like for a particular actor
"""
postJsonObject = loadJson(postFilename)
if postJsonObject:
if not postJsonObject:
return
# remove any cached version of this post so that the
# like icon is changed
nickname = getNicknameFromActor(actor)
@ -1892,7 +1894,8 @@ def undoLikesCollectionEntry(recentPostsCache: {},
postJsonObject['object']['likes']['items'].remove(likeItem)
itemFound = True
break
if itemFound:
if not itemFound:
return
if totalItems == 1:
if debug:
print('DEBUG: likes was removed from post')