mirror of https://gitlab.com/bashrc2/epicyon
Check that the same notification is not repeatedly sent
parent
5bc7f28685
commit
c417566675
11
inbox.py
11
inbox.py
|
@ -1858,9 +1858,14 @@ def _notifyPostArrival(baseDir: str, handle: str, url: str) -> None:
|
||||||
if not os.path.isdir(accountDir):
|
if not os.path.isdir(accountDir):
|
||||||
return
|
return
|
||||||
notifyFile = accountDir + '/.newNotifiedPost'
|
notifyFile = accountDir + '/.newNotifiedPost'
|
||||||
if not os.path.isfile(notifyFile):
|
if os.path.isfile(notifyFile):
|
||||||
with open(notifyFile, 'w+') as fp:
|
# check that the same notification is not repeatedly sent
|
||||||
fp.write(url)
|
with open(notifyFile, 'r') as fp:
|
||||||
|
existingNotificationMessage = fp.read()
|
||||||
|
if url in existingNotificationMessage:
|
||||||
|
return
|
||||||
|
with open(notifyFile, 'w+') as fp:
|
||||||
|
fp.write(url)
|
||||||
|
|
||||||
|
|
||||||
def _replyNotify(baseDir: str, handle: str, url: str) -> None:
|
def _replyNotify(baseDir: str, handle: str, url: str) -> None:
|
||||||
|
|
Loading…
Reference in New Issue