No repeat icon on DMs

master
Bob Mottram 2019-08-25 18:22:24 +01:00
parent 2236306f11
commit 7019bd86da
1 changed files with 31 additions and 29 deletions

View File

@ -23,6 +23,7 @@ from utils import isPublicPost
from utils import getDisplayName from utils import getDisplayName
from follow import isFollowingActor from follow import isFollowingActor
from webfinger import webfingerHandle from webfinger import webfingerHandle
from posts import isDM
from posts import getPersonBox from posts import getPersonBox
from posts import getUserUrl from posts import getUserUrl
from posts import parseUserFeed from posts import parseUserFeed
@ -1158,37 +1159,38 @@ def individualPostAsHtml(baseDir: str, \
titleStr+='<a href="'+messageId+'">'+displayName+'</a>' titleStr+='<a href="'+messageId+'">'+displayName+'</a>'
else: else:
titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>' titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>'
if isAnnounced: if not isDM(postJsonObject):
if postJsonObject['object'].get('attributedTo'): if isAnnounced:
announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo']) if postJsonObject['object'].get('attributedTo'):
announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo']) announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo'])
announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache) announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo'])
if announceDisplayName: announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache)
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">'+announceDisplayName+'</a>' if announceDisplayName:
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">'+announceDisplayName+'</a>'
else:
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>'
else: else:
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>' titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@unattributed</a>'
else: else:
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@unattributed</a>' if postJsonObject['object'].get('inReplyTo'):
else: containerClassIcons='containericons darker'
if postJsonObject['object'].get('inReplyTo'): containerClass='container darker'
containerClassIcons='containericons darker' #avatarPosition=' class="right"'
containerClass='container darker' if '/statuses/' in postJsonObject['object']['inReplyTo']:
#avatarPosition=' class="right"' replyNickname=getNicknameFromActor(postJsonObject['object']['inReplyTo'])
if '/statuses/' in postJsonObject['object']['inReplyTo']: replyDomain,replyPort=getDomainFromActor(postJsonObject['object']['inReplyTo'])
replyNickname=getNicknameFromActor(postJsonObject['object']['inReplyTo']) if replyNickname and replyDomain:
replyDomain,replyPort=getDomainFromActor(postJsonObject['object']['inReplyTo']) replyDisplayName=getDisplayName(postJsonObject['object']['inReplyTo'],personCache)
if replyNickname and replyDomain: if replyDisplayName:
replyDisplayName=getDisplayName(postJsonObject['object']['inReplyTo'],personCache) titleStr+=' <img src="/icons/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">'+replyDisplayName+'</a>'
if replyDisplayName: else:
titleStr+=' <img src="/icons/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">'+replyDisplayName+'</a>' titleStr+=' <img src="/icons/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>'
else: else:
titleStr+=' <img src="/icons/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">@'+replyNickname+'@'+replyDomain+'</a>' postDomain=postJsonObject['object']['inReplyTo'].replace('https://','').replace('http://','').replace('dat://','')
else: if '/' in postDomain:
postDomain=postJsonObject['object']['inReplyTo'].replace('https://','').replace('http://','').replace('dat://','') postDomain=postDomain.split('/',1)[0]
if '/' in postDomain: titleStr+=' <img src="/icons/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">'+postDomain+'</a>'
postDomain=postDomain.split('/',1)[0]
titleStr+=' <img src="/icons/reply.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['inReplyTo']+'">'+postDomain+'</a>'
attachmentStr='' attachmentStr=''
if postJsonObject['object']['attachment']: if postJsonObject['object']['attachment']:
if isinstance(postJsonObject['object']['attachment'], list): if isinstance(postJsonObject['object']['attachment'], list):