forked from indymedia/epicyon
Create index entry for new report
parent
28d1869826
commit
8ea168c5ab
13
posts.py
13
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
|
||||
|
|
Loading…
Reference in New Issue