Check for snooze file

main2
Bob Mottram 2019-11-06 11:57:43 +00:00
parent 5388c6d70a
commit 7241d5def8
1 changed files with 3 additions and 2 deletions

View File

@ -798,8 +798,9 @@ def personSnooze(baseDir: str,nickname: str,domain: str,snoozeActor: str) -> Non
print('ERROR: unknown account '+accountDir)
return
snoozedFilename=accountDir+'/snoozed.txt'
if snoozeActor+' ' in open(snoozedFilename).read():
return
if os.path.isfile(snoozedFilename):
if snoozeActor+' ' in open(snoozedFilename).read():
return
snoozedFile=open(snoozedFilename, "a+")
if snoozedFile:
snoozedFile.write(snoozeActor+' '+str(int(time.time()))+'\n')