Merge branch 'main' of ssh://code.freedombone.net:2222/bashrc/epicyon into main

main
Bob Mottram 2021-03-15 10:53:46 +00:00
commit a8076601de
4 changed files with 17 additions and 7 deletions

View File

@ -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()

View File

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

View File

@ -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('')

View File

@ -473,24 +473,28 @@ def updateAvatarImageCache(session, baseDir: str, httpPrefix: str,
if (not os.path.isfile(avatarImageFilename) or force) and allowDownloads:
try:
print('avatar image url: ' + avatarUrl)
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:
print('Avatar image download failed with status ' +
str(result.status_code))
if debug:
print('Avatar image download failed with status ' +
str(result.status_code))
# remove partial download
if os.path.isfile(avatarImageFilename):
os.remove(avatarImageFilename)
else:
with open(avatarImageFilename, 'wb') as f:
f.write(result.content)
print('avatar image downloaded for ' + actor)
if debug:
print('avatar image downloaded for ' + actor)
return avatarImageFilename.replace(baseDir + '/cache', '')
except Exception as e:
print('Failed to download avatar image: ' + str(avatarUrl))
if debug:
print('Failed to download avatar image: ' + str(avatarUrl))
print(e)
prof = 'https://www.w3.org/ns/activitystreams'
if '/channel/' not in actor or '/accounts/' not in actor: