Skip to content

Commit

Permalink
RSS feed bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Oct 12, 2023
1 parent 75c68d4 commit 023b05e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,24 +216,19 @@ def maybe_set(future):

tasklets.wait_all(gets)

actor = {
'displayName': id,
'url': g.user.web_url(),
}

# TODO: inject/merge common.pretty_link into microformats2.render_content
# (specifically into hcard_to_html) somehow to convert Mastodon URLs to @-@
# syntax. maybe a fediverse kwarg down through the call chain?
if format == 'html':
entries = [microformats2.object_to_html(a) for a in activities]
return render_template('feed.html', **TEMPLATE_VARS, **locals())
elif format == 'atom':
body = atom.activities_to_atom(activities, actor=actor, title=title,
request_url=request.url)
body = atom.activities_to_atom(activities, actor=g.user.obj.as1,
title=title, request_url=request.url)
return body, {'Content-Type': atom.CONTENT_TYPE}
elif format == 'rss':
body = rss.from_activities(activities, actor=actor, title=title,
feed_url=request.url)
body = rss.from_activities(activities, actor=g.user.obj.as1,
title=title, feed_url=request.url)
return body, {'Content-Type': rss.CONTENT_TYPE}


Expand Down

0 comments on commit 023b05e

Please sign in to comment.