diff --git a/posts.py b/posts.py index b9ca67ee..5fa9b333 100644 --- a/posts.py +++ b/posts.py @@ -1012,10 +1012,21 @@ def createReportPost(baseDir: str, None,None,None) if not postJsonObject: continue + handle=toNickname+'@'+domain + + # update the inbox index with the report filename + indexFilename=baseDir+'/accounts/'+handle+'/inbox.index' + indexEntry=postJsonObject['id'].replace('/activity','').replace('/','#')+'.json' + if indexEntry not in open(indexFilename).read(): + try: + with open(indexFilename, 'a+') as fp: + fp.write(indexEntry) + except: + pass + # save a notification file so that the moderator # knows something new has appeared toNickname=toUrl.split('/users/')[1] - handle=toNickname+'@'+domain newReportFile=baseDir+'/accounts/'+handle+'/.newReport' if os.path.isfile(newReportFile): continue