mirror of https://gitlab.com/bashrc2/epicyon
Include announced handle within speaker interface
parent
2787ceb724
commit
2b26b09980
12
inbox.py
12
inbox.py
|
@ -1412,7 +1412,7 @@ def _receiveAnnounce(recentPostsCache: {},
|
|||
if not alreadyExists:
|
||||
_updateSpeaker(baseDir, nickname, domain,
|
||||
postJsonObject, personCache,
|
||||
translate)
|
||||
translate, lookupActor)
|
||||
|
||||
if debug:
|
||||
print('DEBUG: Obtaining actor for announce post ' +
|
||||
|
@ -2149,7 +2149,7 @@ def _bounceDM(senderPostId: str, session, httpPrefix: str,
|
|||
|
||||
def _updateSpeaker(baseDir: str, nickname: str, domain: str,
|
||||
postJsonObject: {}, personCache: {},
|
||||
translate: {}) -> None:
|
||||
translate: {}, announcingActor: str) -> None:
|
||||
""" Generates a json file which can be used for TTS announcement
|
||||
of incoming inbox posts
|
||||
"""
|
||||
|
@ -2192,6 +2192,12 @@ def _updateSpeaker(baseDir: str, nickname: str, domain: str,
|
|||
getDisplayName(baseDir, postJsonObject['actor'], personCache)
|
||||
if not speakerName:
|
||||
return
|
||||
if announcingActor:
|
||||
announcedNickname = getNicknameFromActor(announcingActor)
|
||||
announcedDomain = getDomainFromActor(announcingActor)
|
||||
announcedHandle = announcedNickname + '@' + announcedDomain
|
||||
content = \
|
||||
translate['announces'] + ' ' + announcedHandle + '. ' + content
|
||||
speakerJson = {
|
||||
"name": speakerName,
|
||||
"summary": summary,
|
||||
|
@ -2539,7 +2545,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
|||
if boxname == 'inbox':
|
||||
_updateSpeaker(baseDir, nickname, domain,
|
||||
postJsonObject, personCache,
|
||||
translate)
|
||||
translate, None)
|
||||
if not unitTest:
|
||||
if debug:
|
||||
print('Saving inbox post as html to cache')
|
||||
|
|
Loading…
Reference in New Issue