diff --git a/notifications_client.py b/notifications_client.py index 20b0381b8..389d8b830 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -569,6 +569,9 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, speakerJson['say'] = messageStr speakerJson['decrypted'] = True _storeMessage(speakerJson) + elif speakerJson.get('direct'): + speakerJson['decrypted'] = False + _storeMessage(speakerJson) print('') diff --git a/speaker.py b/speaker.py index 2d158cc30..e77444d4d 100644 --- a/speaker.py +++ b/speaker.py @@ -12,6 +12,7 @@ import random import urllib.parse from auth import createBasicAuthHeader from session import getJson +from utils import isDM from utils import camelCaseSplit from utils import getDomainFromActor from utils import getNicknameFromActor @@ -284,7 +285,8 @@ def _speakerEndpointJson(displayName: str, summary: str, postDM: bool, postReply: bool, followRequestsExist: bool, likedBy: str, published: str, postCal: bool, - postShare: bool, themeName: str) -> {}: + postShare: bool, themeName: str, + isDirect: bool) -> {}: """Returns a json endpoint for the TTS speaker """ speakerJson = { @@ -296,6 +298,7 @@ def _speakerEndpointJson(displayName: str, summary: str, "imageDescription": imageDescription, "detectedLinks": links, "id": postId, + "direct": isDirect, "notify": { "theme": themeName, "dm": postDM, @@ -445,6 +448,8 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str, imageDescription += \ img['name'] + '. ' + isDirect = isDM(postJsonObject) + published = '' if postJsonObject['object'].get('published'): published = postJsonObject['object']['published'] @@ -512,7 +517,8 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str, postDM, postReply, followRequestsExist, likedBy, published, - postCal, postShare, themeName) + postCal, postShare, themeName, + isDirect) def updateSpeaker(baseDir: str, httpPrefix: str,