From 8e780492d36a33e8df63a9699f8785f918f98fcf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 6 Oct 2019 16:07:40 +0100 Subject: [PATCH] Include url within notification file --- inbox.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inbox.py b/inbox.py index 76d14183e..6b561cb17 100644 --- a/inbox.py +++ b/inbox.py @@ -1222,7 +1222,7 @@ def obtainAvatarForReplyPost(session,baseDir: str,httpPrefix: str,domain: str,pe ' obtaining actor for '+lookupActor) time.sleep(5) -def dmNotify(baseDir: str,handle: str) -> None: +def dmNotify(baseDir: str,handle: str,url: str) -> None: """Creates a notification that a new DM has arrived """ accountDir=baseDir+'/accounts/'+handle @@ -1231,7 +1231,7 @@ def dmNotify(baseDir: str,handle: str) -> None: dmFile=accountDir+'/.newDM' if not os.path.isfile(dmFile): with open(dmFile, 'w') as fp: - fp.write('\n') + fp.write(url) def replyNotify(baseDir: str,handle: str) -> None: """Creates a notification that a new reply has arrived @@ -1453,7 +1453,8 @@ def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \ if not isGroup: # create a DM notification file if needed if isDM(postJsonObject): - dmNotify(baseDir,handle) + nickname=handle.split('@')[0] + dmNotify(baseDir,handle,httpPrefix+'://'+domain+'/users/'+nickname+'/dm') # get the actor being replied to domainFull=domain