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:
|
if not alreadyExists:
|
||||||
_updateSpeaker(baseDir, nickname, domain,
|
_updateSpeaker(baseDir, nickname, domain,
|
||||||
postJsonObject, personCache,
|
postJsonObject, personCache,
|
||||||
translate)
|
translate, lookupActor)
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: Obtaining actor for announce post ' +
|
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,
|
def _updateSpeaker(baseDir: str, nickname: str, domain: str,
|
||||||
postJsonObject: {}, personCache: {},
|
postJsonObject: {}, personCache: {},
|
||||||
translate: {}) -> None:
|
translate: {}, announcingActor: str) -> None:
|
||||||
""" Generates a json file which can be used for TTS announcement
|
""" Generates a json file which can be used for TTS announcement
|
||||||
of incoming inbox posts
|
of incoming inbox posts
|
||||||
"""
|
"""
|
||||||
|
@ -2192,6 +2192,12 @@ def _updateSpeaker(baseDir: str, nickname: str, domain: str,
|
||||||
getDisplayName(baseDir, postJsonObject['actor'], personCache)
|
getDisplayName(baseDir, postJsonObject['actor'], personCache)
|
||||||
if not speakerName:
|
if not speakerName:
|
||||||
return
|
return
|
||||||
|
if announcingActor:
|
||||||
|
announcedNickname = getNicknameFromActor(announcingActor)
|
||||||
|
announcedDomain = getDomainFromActor(announcingActor)
|
||||||
|
announcedHandle = announcedNickname + '@' + announcedDomain
|
||||||
|
content = \
|
||||||
|
translate['announces'] + ' ' + announcedHandle + '. ' + content
|
||||||
speakerJson = {
|
speakerJson = {
|
||||||
"name": speakerName,
|
"name": speakerName,
|
||||||
"summary": summary,
|
"summary": summary,
|
||||||
|
@ -2539,7 +2545,7 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
|
||||||
if boxname == 'inbox':
|
if boxname == 'inbox':
|
||||||
_updateSpeaker(baseDir, nickname, domain,
|
_updateSpeaker(baseDir, nickname, domain,
|
||||||
postJsonObject, personCache,
|
postJsonObject, personCache,
|
||||||
translate)
|
translate, None)
|
||||||
if not unitTest:
|
if not unitTest:
|
||||||
if debug:
|
if debug:
|
||||||
print('Saving inbox post as html to cache')
|
print('Saving inbox post as html to cache')
|
||||||
|
|
Loading…
Reference in New Issue