From 9a9c9b9d569f2286b47f6d719f00712e9cc208cf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 11 Mar 2021 12:30:29 +0000 Subject: [PATCH] Check that DM handle exists --- notifications_client.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 0424a670d..85db40341 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -542,17 +542,19 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, keyPress.startswith('send '): keyPress = keyPress.replace(' to ', '') # direct message + toHandle = None if keyPress.startswith('post '): toHandle = keyPress.split('post ', 1)[1] - else: + elif keyPress.startswith('send '): toHandle = keyPress.split('send ', 1)[1] - _notificationNewDM(sessionPost, toHandle, - baseDir, nickname, password, - domain, port, httpPrefix, - cachedWebfingers, personCache, - debug, - screenreader, systemLanguage, - espeak) + if toHandle: + _notificationNewDM(sessionPost, toHandle, + baseDir, nickname, password, + domain, port, httpPrefix, + cachedWebfingers, personCache, + debug, + screenreader, systemLanguage, + espeak) else: # public post _notificationNewPost(sessionPost,