Desktop client replies timeline

merge-requests/21/head
Bob Mottram 2021-03-16 13:08:15 +00:00
parent 1442c15339
commit 2716fefd0b
1 changed files with 21 additions and 0 deletions

View File

@ -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: