diff --git a/daemon.py b/daemon.py index 7c0f9f4a8..0d4fd65cd 100644 --- a/daemon.py +++ b/daemon.py @@ -1635,7 +1635,8 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy=False return hashtagStr= \ - htmlHashtagSearch(self.server.recentPostsCache, \ + htmlHashtagSearch(self.server.domain, \ + self.server.recentPostsCache, \ self.server.maxRecentPosts, \ self.server.translate, \ self.server.baseDir,hashtag,pageNumber, \ @@ -4648,7 +4649,8 @@ class PubServer(BaseHTTPRequestHandler): if searchStr.startswith('#'): # hashtag search hashtagStr= \ - htmlHashtagSearch(self.server.recentPostsCache, \ + htmlHashtagSearch(self.server.domain, \ + self.server.recentPostsCache, \ self.server.maxRecentPosts, \ self.server.translate, \ self.server.baseDir,searchStr[1:],1, \ diff --git a/inbox.py b/inbox.py index 59d4ab9c3..1977115b3 100644 --- a/inbox.py +++ b/inbox.py @@ -60,7 +60,7 @@ from webinterface import individualPostAsHtml from webinterface import getIconsDir from question import questionUpdateVotes -def storeHashTags(baseDir: str,postJsonObject: {}) -> None: +def storeHashTags(baseDir: str,nickname: str,postJsonObject: {}) -> None: """Extracts hashtags from an incoming post and updates the relevant tags files. """ @@ -90,7 +90,7 @@ def storeHashTags(baseDir: str,postJsonObject: {}) -> None: if not os.path.isfile(tagsFilename): tagsFile=open(tagsFilename, "w+") if tagsFile: - tagsFile.write(postUrl+'\n') + tagsFile.write(nickname+' '+postUrl+'\n') tagsFile.close() else: if postUrl not in open(tagsFilename).read(): @@ -98,7 +98,7 @@ def storeHashTags(baseDir: str,postJsonObject: {}) -> None: with open(tagsFilename, 'r+') as tagsFile: content = tagsFile.read() tagsFile.seek(0, 0) - tagsFile.write(postUrl+'\n'+content) + tagsFile.write(nickname+' '+postUrl+'\n'+content) except Exception as e: print('WARN: Failed to write entry to tags file '+ \ tagsFilename+' '+str(e)) @@ -1920,7 +1920,7 @@ def inboxAfterCapabilities(recentPostsCache: {},maxRecentPosts: int, \ inboxUpdateCalendar(baseDir,handle,postJsonObject) - storeHashTags(baseDir,postJsonObject) + storeHashTags(baseDir,handle.split('@')[0],postJsonObject) if not unitTest: if debug: diff --git a/webinterface.py b/webinterface.py index 8b6448485..f4b83f39f 100644 --- a/webinterface.py +++ b/webinterface.py @@ -345,9 +345,11 @@ def htmlModerationInfo(translate: {},baseDir: str,httpPrefix: str) -> str: infoForm+=htmlFooter() return infoForm -def htmlHashtagSearch(recentPostsCache: {},maxRecentPosts: int, \ +def htmlHashtagSearch(domain: str, \ + recentPostsCache: {},maxRecentPosts: int, \ translate: {}, \ - baseDir: str,hashtag: str,pageNumber: int,postsPerPage: int, \ + baseDir: str,hashtag: str,pageNumber: int, \ + postsPerPage: int, \ session,wfRequest: {},personCache: {}, \ httpPrefix: str,projectVersion: str) -> str: """Show a page containing search results for a hashtag @@ -381,18 +383,22 @@ def htmlHashtagSearch(recentPostsCache: {},maxRecentPosts: int, \ hashtagSearchForm+='