mirror of https://gitlab.com/bashrc2/epicyon
Check that calendar event does not already exist
parent
da7d9b4ea4
commit
44d7c791b4
8
inbox.py
8
inbox.py
|
@ -1387,11 +1387,15 @@ def inboxUpdateCalendar(baseDir: str,handle: str,postJsonObject: {}) -> None:
|
||||||
if not os.path.isdir(calendarPath+'/'+str(eventYear)):
|
if not os.path.isdir(calendarPath+'/'+str(eventYear)):
|
||||||
os.mkdir(calendarPath+'/'+str(eventYear))
|
os.mkdir(calendarPath+'/'+str(eventYear))
|
||||||
calendarFilename=calendarPath+'/'+str(eventYear)+'/'+str(eventMonthNumber)+'.txt'
|
calendarFilename=calendarPath+'/'+str(eventYear)+'/'+str(eventMonthNumber)+'.txt'
|
||||||
|
postId=postJsonObject['id'].replace('/','#')
|
||||||
|
if os.path.isfile(calendarFilename):
|
||||||
|
if postId in open(calendarFilename).read():
|
||||||
|
return
|
||||||
calendarFile=open(calendarFilename,'a+')
|
calendarFile=open(calendarFilename,'a+')
|
||||||
if calendarFile:
|
if calendarFile:
|
||||||
calendarFile.write(postJsonObject['id'].replace('/','#')+'\n')
|
calendarFile.write(postId+'\n')
|
||||||
calendarFile.close()
|
calendarFile.close()
|
||||||
|
|
||||||
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
||||||
baseDir: str,httpPrefix: str,sendThreads: [], \
|
baseDir: str,httpPrefix: str,sendThreads: [], \
|
||||||
postLog: [],cachedWebfingers: {},personCache: {}, \
|
postLog: [],cachedWebfingers: {},personCache: {}, \
|
||||||
|
|
Loading…
Reference in New Issue