Check that DM handle exists

merge-requests/30/head
Bob Mottram 2021-03-11 12:30:29 +00:00
parent ec63a0ea44
commit 9a9c9b9d56
1 changed files with 10 additions and 8 deletions

View File

@ -542,17 +542,19 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
keyPress.startswith('send '): keyPress.startswith('send '):
keyPress = keyPress.replace(' to ', '') keyPress = keyPress.replace(' to ', '')
# direct message # direct message
toHandle = None
if keyPress.startswith('post '): if keyPress.startswith('post '):
toHandle = keyPress.split('post ', 1)[1] toHandle = keyPress.split('post ', 1)[1]
else: elif keyPress.startswith('send '):
toHandle = keyPress.split('send ', 1)[1] toHandle = keyPress.split('send ', 1)[1]
_notificationNewDM(sessionPost, toHandle, if toHandle:
baseDir, nickname, password, _notificationNewDM(sessionPost, toHandle,
domain, port, httpPrefix, baseDir, nickname, password,
cachedWebfingers, personCache, domain, port, httpPrefix,
debug, cachedWebfingers, personCache,
screenreader, systemLanguage, debug,
espeak) screenreader, systemLanguage,
espeak)
else: else:
# public post # public post
_notificationNewPost(sessionPost, _notificationNewPost(sessionPost,