From 702ed23d0ecb2f93191f3c9940fd709f414f3114 Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Sat, 2 Nov 2019 12:11:59 +0000
Subject: [PATCH] Include link in new share notification file

---
 shares.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/shares.py b/shares.py
index 5edb7700..cacff618 100644
--- a/shares.py
+++ b/shares.py
@@ -102,14 +102,15 @@ def addShare(baseDir: str, \
             imageFilename=sharesImageFilename+'.gif'
             moveImage=True
 
+    domainFull=domain
+    if port:
+        if port!=80 and port!=443:
+            if ':' not in domain:
+                domainFull=domain+':'+str(port)
+
     # copy or move the image for the shared item to its destination
     if imageFilename:
         if os.path.isfile(imageFilename):
-            domainFull=domain
-            if port:
-                if port!=80 and port!=443:
-                    if ':' not in domain:
-                        domainFull=domain+':'+str(port)
             if not os.path.isdir(baseDir+'/sharefiles'):
                 os.mkdir(baseDir+'/sharefiles')
             if not os.path.isdir(baseDir+'/sharefiles/'+nickname):
@@ -151,9 +152,10 @@ def addShare(baseDir: str, \
                 accountDir=baseDir+'/accounts/'+handle
                 newShareFile=accountDir+'/.newShare'
                 if not os.path.isfile(newShareFile):
+                    nickname=handle.split('@')[0]
                     try:
                         with open(newShareFile, 'w') as fp:
-                            fp.write('\n')
+                            fp.write(httpPrefix+'://'+domainFull+'/users/'+nickname+'/tlshares')
                     except:
                         pass