mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon into main
commit
a8076601de
|
|
@ -1860,12 +1860,16 @@ if args.notifications:
|
|||
elif args.gnunet:
|
||||
proxyType = 'gnunet'
|
||||
|
||||
# only store inbox posts if we are not running as a daemon
|
||||
storeInboxPosts = not args.noKeyPress
|
||||
|
||||
runNotificationsClient(baseDir, proxyType, httpPrefix,
|
||||
nickname, domain, port, args.password,
|
||||
args.screenreader, args.language,
|
||||
args.notificationSounds,
|
||||
args.notificationType,
|
||||
args.noKeyPress,
|
||||
storeInboxPosts,
|
||||
args.debug)
|
||||
sys.exit()
|
||||
|
||||
|
|
|
|||
2
inbox.py
2
inbox.py
|
|
@ -2677,7 +2677,7 @@ def runInboxQueue(recentPostsCache: {}, maxRecentPosts: int,
|
|||
time.sleep(1)
|
||||
|
||||
# heartbeat to monitor whether the inbox queue is running
|
||||
heartBeatCtr += 5
|
||||
heartBeatCtr += 1
|
||||
if heartBeatCtr >= 10:
|
||||
# turn off broch mode after it has timed out
|
||||
brochModeLapses(baseDir)
|
||||
|
|
|
|||
|
|
@ -575,6 +575,7 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
|||
notificationSounds: bool,
|
||||
notificationType: str,
|
||||
noKeyPress: bool,
|
||||
storeInboxPosts: bool,
|
||||
debug: bool) -> None:
|
||||
"""Runs the notifications and screen reader client,
|
||||
which announces new inbox items
|
||||
|
|
@ -766,7 +767,8 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
|||
_storeMessage(speakerJson, 'dm')
|
||||
else:
|
||||
speakerJson['decrypted'] = False
|
||||
# _storeMessage(speakerJson, 'inbox')
|
||||
if storeInboxPosts:
|
||||
_storeMessage(speakerJson, 'inbox')
|
||||
|
||||
print('')
|
||||
|
||||
|
|
|
|||
|
|
@ -473,12 +473,14 @@ def updateAvatarImageCache(session, baseDir: str, httpPrefix: str,
|
|||
|
||||
if (not os.path.isfile(avatarImageFilename) or force) and allowDownloads:
|
||||
try:
|
||||
if debug:
|
||||
print('avatar image url: ' + avatarUrl)
|
||||
result = session.get(avatarUrl,
|
||||
headers=sessionHeaders,
|
||||
params=None)
|
||||
if result.status_code < 200 or \
|
||||
result.status_code > 202:
|
||||
if debug:
|
||||
print('Avatar image download failed with status ' +
|
||||
str(result.status_code))
|
||||
# remove partial download
|
||||
|
|
@ -487,9 +489,11 @@ def updateAvatarImageCache(session, baseDir: str, httpPrefix: str,
|
|||
else:
|
||||
with open(avatarImageFilename, 'wb') as f:
|
||||
f.write(result.content)
|
||||
if debug:
|
||||
print('avatar image downloaded for ' + actor)
|
||||
return avatarImageFilename.replace(baseDir + '/cache', '')
|
||||
except Exception as e:
|
||||
if debug:
|
||||
print('Failed to download avatar image: ' + str(avatarUrl))
|
||||
print(e)
|
||||
prof = 'https://www.w3.org/ns/activitystreams'
|
||||
|
|
|
|||
Loading…
Reference in New Issue