Sender tag for calendar events

main
Bob Mottram 2021-03-06 18:38:36 +00:00
parent c345290354
commit c038d86e22
2 changed files with 13 additions and 9 deletions

View File

@ -233,6 +233,8 @@ def getTodaysEvents(baseDir: str, nickname: str, domain: str,
# link to the id so that the event can be # link to the id so that the event can be
# easily deleted # easily deleted
tag['postId'] = postId.split('#statuses#')[1] tag['postId'] = postId.split('#statuses#')[1]
tag['sender'] = postId.split('#statuses#')[0]
tag['sender'] = tag['sender'].replace('#', '/')
postEvent.append(tag) postEvent.append(tag)
else: else:
# tag is a place # tag is a place

View File

@ -135,6 +135,7 @@ def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {},
eventDescription = None eventDescription = None
eventPlace = None eventPlace = None
postId = None postId = None
senderName = ''
# get the time place and description # get the time place and description
for ev in eventPost: for ev in eventPost:
if ev['type'] == 'Event': if ev['type'] == 'Event':
@ -145,21 +146,22 @@ def _htmlCalendarDay(personCache: {}, cssCache: {}, translate: {},
datetime.strptime(ev['startTime'], datetime.strptime(ev['startTime'],
"%Y-%m-%dT%H:%M:%S%z") "%Y-%m-%dT%H:%M:%S%z")
eventTime = eventDate.strftime("%H:%M").strip() eventTime = eventDate.strftime("%H:%M").strip()
if ev.get('name'): if ev.get('sender'):
# get display name from sending actor # get display name from sending actor
senderName = '' if ev.get('sender'):
# if ev.get('actor'): senderActor = ev['sender']
# actor = ev['actor'] senderName = \
# senderName = \ '<a href="' + actor + '">' + \
# '<a href="' + actor + '">' + \ getDisplayName(baseDir, senderActor,
# getDisplayName(baseDir, actor, personCache) + '</a>: '
# personCache) + \ if ev.get('name'):
# '</a>: '
eventDescription = senderName + ev['name'].strip() eventDescription = senderName + ev['name'].strip()
elif ev['type'] == 'Place': elif ev['type'] == 'Place':
if ev.get('name'): if ev.get('name'):
eventPlace = ev['name'] eventPlace = ev['name']
if senderName and eventDescription:
eventDescription = senderName + eventDescription
deleteButtonStr = '' deleteButtonStr = ''
if postId: if postId:
deleteButtonStr = \ deleteButtonStr = \