mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon into main
commit
84e2591568
|
|
@ -780,6 +780,7 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
cachedWebfingers = {}
|
cachedWebfingers = {}
|
||||||
personCache = {}
|
personCache = {}
|
||||||
currDMIndex = 0
|
currDMIndex = 0
|
||||||
|
currRepliesIndex = 0
|
||||||
currSentIndex = 0
|
currSentIndex = 0
|
||||||
while (1):
|
while (1):
|
||||||
session = createSession(proxyType)
|
session = createSession(proxyType)
|
||||||
|
|
@ -905,6 +906,8 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
speakerJson['decrypted'] = False
|
speakerJson['decrypted'] = False
|
||||||
if encryptedMessage or speakerJson.get('direct'):
|
if encryptedMessage or speakerJson.get('direct'):
|
||||||
_storeMessage(speakerJson, 'dm')
|
_storeMessage(speakerJson, 'dm')
|
||||||
|
elif speakerJson.get('replyToYou'):
|
||||||
|
_storeMessage(speakerJson, 'replies')
|
||||||
else:
|
else:
|
||||||
if storeInboxPosts:
|
if storeInboxPosts:
|
||||||
_storeMessage(speakerJson, 'inbox')
|
_storeMessage(speakerJson, 'inbox')
|
||||||
|
|
@ -940,6 +943,12 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
screenreader, systemLanguage, espeak,
|
screenreader, systemLanguage, espeak,
|
||||||
currDMIndex, 10)
|
currDMIndex, 10)
|
||||||
currTimeline = 'dm'
|
currTimeline = 'dm'
|
||||||
|
elif keyPress.startswith('show rep'):
|
||||||
|
currRepliesIndex = 0
|
||||||
|
_showLocalBox(notifyJson, 'replies',
|
||||||
|
screenreader, systemLanguage, espeak,
|
||||||
|
currRepliesIndex, 10)
|
||||||
|
currTimeline = 'replies'
|
||||||
elif keyPress.startswith('show sen'):
|
elif keyPress.startswith('show sen'):
|
||||||
currSentIndex = 0
|
currSentIndex = 0
|
||||||
_showLocalBox(notifyJson, 'sent',
|
_showLocalBox(notifyJson, 'sent',
|
||||||
|
|
@ -959,6 +968,11 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
_showLocalBox(notifyJson, 'dm',
|
_showLocalBox(notifyJson, 'dm',
|
||||||
screenreader, systemLanguage, espeak,
|
screenreader, systemLanguage, espeak,
|
||||||
currDMIndex, 10)
|
currDMIndex, 10)
|
||||||
|
elif currTimeline == 'replies':
|
||||||
|
currRepliesIndex += 10
|
||||||
|
_showLocalBox(notifyJson, 'replies',
|
||||||
|
screenreader, systemLanguage, espeak,
|
||||||
|
currRepliesIndex, 10)
|
||||||
elif currTimeline == 'sent':
|
elif currTimeline == 'sent':
|
||||||
currSentIndex += 10
|
currSentIndex += 10
|
||||||
_showLocalBox(notifyJson, 'sent',
|
_showLocalBox(notifyJson, 'sent',
|
||||||
|
|
@ -977,6 +991,13 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
_showLocalBox(notifyJson, 'dm',
|
_showLocalBox(notifyJson, 'dm',
|
||||||
screenreader, systemLanguage, espeak,
|
screenreader, systemLanguage, espeak,
|
||||||
currDMIndex, 10)
|
currDMIndex, 10)
|
||||||
|
elif currTimeline == 'replies':
|
||||||
|
currRepliesIndex -= 10
|
||||||
|
if currRepliesIndex < 0:
|
||||||
|
currRepliesIndex = 0
|
||||||
|
_showLocalBox(notifyJson, 'replies',
|
||||||
|
screenreader, systemLanguage, espeak,
|
||||||
|
currRepliesIndex, 10)
|
||||||
elif currTimeline == 'sent':
|
elif currTimeline == 'sent':
|
||||||
currSentIndex -= 10
|
currSentIndex -= 10
|
||||||
if currSentIndex < 0:
|
if currSentIndex < 0:
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import urllib.parse
|
||||||
from auth import createBasicAuthHeader
|
from auth import createBasicAuthHeader
|
||||||
from session import getJson
|
from session import getJson
|
||||||
from utils import isDM
|
from utils import isDM
|
||||||
|
from utils import isReply
|
||||||
from utils import camelCaseSplit
|
from utils import camelCaseSplit
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
|
|
@ -293,7 +294,7 @@ def _speakerEndpointJson(displayName: str, summary: str,
|
||||||
followRequestsList: [],
|
followRequestsList: [],
|
||||||
likedBy: str, published: str, postCal: bool,
|
likedBy: str, published: str, postCal: bool,
|
||||||
postShare: bool, themeName: str,
|
postShare: bool, themeName: str,
|
||||||
isDirect: bool) -> {}:
|
isDirect: bool, replyToYou: bool) -> {}:
|
||||||
"""Returns a json endpoint for the TTS speaker
|
"""Returns a json endpoint for the TTS speaker
|
||||||
"""
|
"""
|
||||||
speakerJson = {
|
speakerJson = {
|
||||||
|
|
@ -306,6 +307,7 @@ def _speakerEndpointJson(displayName: str, summary: str,
|
||||||
"detectedLinks": links,
|
"detectedLinks": links,
|
||||||
"id": postId,
|
"id": postId,
|
||||||
"direct": isDirect,
|
"direct": isDirect,
|
||||||
|
"replyToYou": replyToYou,
|
||||||
"notify": {
|
"notify": {
|
||||||
"theme": themeName,
|
"theme": themeName,
|
||||||
"dm": postDM,
|
"dm": postDM,
|
||||||
|
|
@ -457,6 +459,8 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str,
|
||||||
img['name'] + '. '
|
img['name'] + '. '
|
||||||
|
|
||||||
isDirect = isDM(postJsonObject)
|
isDirect = isDM(postJsonObject)
|
||||||
|
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
|
||||||
|
replyToYou = isReply(postJsonObject, actor)
|
||||||
|
|
||||||
published = ''
|
published = ''
|
||||||
if postJsonObject['object'].get('published'):
|
if postJsonObject['object'].get('published'):
|
||||||
|
|
@ -531,7 +535,7 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str,
|
||||||
followRequestsList,
|
followRequestsList,
|
||||||
likedBy, published,
|
likedBy, published,
|
||||||
postCal, postShare, themeName,
|
postCal, postShare, themeName,
|
||||||
isDirect)
|
isDirect, replyToYou)
|
||||||
|
|
||||||
|
|
||||||
def updateSpeaker(baseDir: str, httpPrefix: str,
|
def updateSpeaker(baseDir: str, httpPrefix: str,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue