Can send DMs to multiple handles

merge-requests/30/head
Bob Mottram 2021-03-14 10:28:48 +00:00
parent b0313a4c20
commit 7c9a26f4a3
1 changed files with 30 additions and 0 deletions

View File

@ -410,6 +410,36 @@ def _notificationNewDM(session, toHandle: str,
screenreader: str, systemLanguage: str, screenreader: str, systemLanguage: str,
espeak) -> None: espeak) -> None:
"""Use the notification client to create a new direct message """Use the notification client to create a new direct message
which can include multiple destination handles
"""
if ' ' in toHandle:
handlesList = toHandle.split(' ')
elif ',' in toHandle:
handlesList = toHandle.split(',')
elif ';' in toHandle:
handlesList = toHandle.split(';')
else:
handlesList = [toHandle]
for handle in handlesList:
handle = handle.strip()
_notificationNewDMbase(session, handle,
baseDir, nickname, password,
domain, port, httpPrefix,
cachedWebfingers, personCache,
debug,
screenreader, systemLanguage,
espeak)
def _notificationNewDMbase(session, toHandle: str,
baseDir: str, nickname: str, password: str,
domain: str, port: int, httpPrefix: str,
cachedWebfingers: {}, personCache: {},
debug: bool,
screenreader: str, systemLanguage: str,
espeak) -> None:
"""Use the notification client to create a new direct message
""" """
toPort = port toPort = port
if '://' in toHandle: if '://' in toHandle: