mirror of https://gitlab.com/bashrc2/epicyon
Show content warnings in desktop client
parent
c41e29c699
commit
c13d4f6e93
|
@ -262,6 +262,7 @@ def _desktopReplyToPost(session, postId: str,
|
||||||
sayStr = 'No reply was entered.'
|
sayStr = 'No reply was entered.'
|
||||||
_sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak)
|
_sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak)
|
||||||
return
|
return
|
||||||
|
print('')
|
||||||
sayStr = 'You entered this reply:'
|
sayStr = 'You entered this reply:'
|
||||||
_sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak)
|
_sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak)
|
||||||
_sayCommand(replyMessage, replyMessage, screenreader,
|
_sayCommand(replyMessage, replyMessage, screenreader,
|
||||||
|
@ -651,6 +652,11 @@ def _desktopShowBox(boxName: str, boxJson: {},
|
||||||
posStr = _padToWidth(ctrStr, numberWidth)
|
posStr = _padToWidth(ctrStr, numberWidth)
|
||||||
|
|
||||||
authorActor = postJsonObject['object']['attributedTo']
|
authorActor = postJsonObject['object']['attributedTo']
|
||||||
|
contentWarning = None
|
||||||
|
if postJsonObject['object'].get('summary'):
|
||||||
|
contentWarning = '⚡' + \
|
||||||
|
_padToWidth(postJsonObject['object']['summary'],
|
||||||
|
contentWidth)
|
||||||
name = getNicknameFromActor(authorActor)
|
name = getNicknameFromActor(authorActor)
|
||||||
|
|
||||||
# append icons to the end of the name
|
# append icons to the end of the name
|
||||||
|
@ -660,12 +666,6 @@ def _desktopShowBox(boxName: str, boxJson: {},
|
||||||
spaceAdded = True
|
spaceAdded = True
|
||||||
name += ' '
|
name += ' '
|
||||||
name += '↲'
|
name += '↲'
|
||||||
if boxName != 'dm':
|
|
||||||
if isDM(postJsonObject):
|
|
||||||
if not spaceAdded:
|
|
||||||
spaceAdded = True
|
|
||||||
name += ' '
|
|
||||||
name += '📧'
|
|
||||||
likesCount = noOfLikes(postJsonObject)
|
likesCount = noOfLikes(postJsonObject)
|
||||||
if likesCount > 10:
|
if likesCount > 10:
|
||||||
likesCount = 10
|
likesCount = 10
|
||||||
|
@ -679,11 +679,24 @@ def _desktopShowBox(boxName: str, boxJson: {},
|
||||||
published = _formatPublished(postJsonObject['published'])
|
published = _formatPublished(postJsonObject['published'])
|
||||||
|
|
||||||
content = _textOnlyContent(postJsonObject['object']['content'])
|
content = _textOnlyContent(postJsonObject['object']['content'])
|
||||||
|
if boxName != 'dm':
|
||||||
|
if isDM(postJsonObject):
|
||||||
|
content = '📧' + content
|
||||||
|
if not contentWarning:
|
||||||
if isPGPEncrypted(content):
|
if isPGPEncrypted(content):
|
||||||
content = '🔒' + content
|
content = '🔒' + content
|
||||||
elif '://' in content:
|
elif '://' in content:
|
||||||
content = '🔗' + content
|
content = '🔗' + content
|
||||||
content = _padToWidth(content, contentWidth)
|
content = _padToWidth(content, contentWidth)
|
||||||
|
else:
|
||||||
|
# display content warning
|
||||||
|
if isPGPEncrypted(content):
|
||||||
|
content = '🔒' + contentWarning
|
||||||
|
else:
|
||||||
|
if '://' in content:
|
||||||
|
content = '🔗' + contentWarning
|
||||||
|
else:
|
||||||
|
content = contentWarning
|
||||||
print(indent + str(posStr) + ' | ' + name + ' | ' +
|
print(indent + str(posStr) + ' | ' + name + ' | ' +
|
||||||
published + ' | ' + content)
|
published + ' | ' + content)
|
||||||
ctr += 1
|
ctr += 1
|
||||||
|
|
Loading…
Reference in New Issue