diff --git a/webinterface.py b/webinterface.py index dcc0466e..4eea3fd3 100644 --- a/webinterface.py +++ b/webinterface.py @@ -316,6 +316,26 @@ def htmlFollowingList(baseDir: str, followingFilename: str) -> str: return '' +def htmlFollowingDataList(baseDir: str, nickname: str, domain: str) -> str: + """Returns a datalist of handles being followed + """ + listStr = '\n' + followingFilename = \ + baseDir + '/accounts/' + nickname + '@' + domain + '/following.txt' + if os.path.isfile(followingFilename): + with open(followingFilename, 'r') as followingFile: + msg = followingFile.read() + followingList = msg.split('\n') + followingList.sort() + if followingList: + for followingAddress in followingList: + if followingAddress: + listStr += \ + '\n' + listStr += '\n' + return listStr + + def htmlSearchEmoji(translate: {}, baseDir: str, httpPrefix: str, searchStr: str) -> str: """Search results for emoji @@ -2113,17 +2133,18 @@ def htmlNewPost(mediaInstance: bool, translate: {}, if inReplyTo: newPostForm += \ '
' + '
\n' else: newPostForm += \ ' ' \ ' 📄
' + translate['Send to'] + ':' + ' 📄
\n' newPostForm += \ ' ' + 'list="followingHandles" value="' + mentionsStr + '" selected>\n' + newPostForm += htmlFollowingDataList(baseDir, nickname, domain) newPostForm += '' selectedStr = ''