Add yourself to the dm recipients list

main
Bob Mottram 2020-06-29 10:48:46 +01:00
parent e789f88c4b
commit efdcd2eb0f
2 changed files with 13 additions and 6 deletions

View File

@ -3377,7 +3377,8 @@ class PubServer(BaseHTTPRequestHandler):
replyToList,
shareDescription,
replyPageNumber,
nickname, self.server.domain).encode('utf-8')
nickname, self.server.domain,
self.server.domainFull).encode('utf-8')
if not msg:
print('Error replying to ' + inReplyToUrl)
self._404()
@ -7687,7 +7688,8 @@ class PubServer(BaseHTTPRequestHandler):
[optionsActor], None,
pageNumber,
chooserNickname,
self.server.domain).encode('utf-8')
self.server.domain,
self.server.domainFull).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)
@ -7754,7 +7756,8 @@ class PubServer(BaseHTTPRequestHandler):
reportPath, None, [],
postUrl, pageNumber,
chooserNickname,
self.server.domain).encode('utf-8')
self.server.domain,
self.server.domainFull).encode('utf-8')
self._set_headers('text/html', len(msg),
cookie, callingDomain)
self._write(msg)

View File

@ -316,7 +316,8 @@ def htmlFollowingList(baseDir: str, followingFilename: str) -> str:
return ''
def htmlFollowingDataList(baseDir: str, nickname: str, domain: str) -> str:
def htmlFollowingDataList(baseDir: str, nickname: str,
domain: str, domainFull: str) -> str:
"""Returns a datalist of handles being followed
"""
listStr = '<datalist id="followingHandles">\n'
@ -325,6 +326,7 @@ def htmlFollowingDataList(baseDir: str, nickname: str, domain: str) -> str:
if os.path.isfile(followingFilename):
with open(followingFilename, 'r') as followingFile:
msg = followingFile.read()
msg += nickname + '@' + domainFull + '\n'
followingList = msg.split('\n')
followingList.sort()
if followingList:
@ -1735,7 +1737,8 @@ def htmlNewPost(mediaInstance: bool, translate: {},
path: str, inReplyTo: str,
mentions: [],
reportUrl: str, pageNumber: int,
nickname: str, domain: str) -> str:
nickname: str, domain: str,
domainFull: str) -> str:
"""New post screen
"""
iconsDir = getIconsDir(baseDir)
@ -2144,7 +2147,8 @@ def htmlNewPost(mediaInstance: bool, translate: {},
newPostForm += \
' <input type="text" name="mentions" ' + \
'list="followingHandles" value="' + mentionsStr + '" selected>\n'
newPostForm += htmlFollowingDataList(baseDir, nickname, domain)
newPostForm += \
htmlFollowingDataList(baseDir, nickname, domain, domainFull)
newPostForm += ''
selectedStr = ''