Bugfixes by @cwt (#42)

* check for missing actor in stream item

* reply on my own status

* fix img exceed div

* check for "actor" key in item.meta before render

* force UTF-8 text encoding

* check if a is a dict or string

* check d object must be dict to get url or id

* json/atom/rss feed

* handle missing root_id

* fix newer-link hover

* fix older-link position

* quick hack to support peertube video

* enable IndieAuth endpoint

* fix 500 when remote follow
This commit is contained in:
Thomas Sileo
2019-02-24 21:04:09 +01:00
committed by GitHub
parent 1926ba92fa
commit 1a7a02a221
7 changed files with 72 additions and 22 deletions

View File

@@ -523,8 +523,8 @@ def gen_feed():
fg.logo(ME.get("icon", {}).get("url"))
fg.language("en")
for item in DB.activities.find(
{"box": Box.OUTBOX.value, "type": "Create"}, limit=50
):
{"box": Box.OUTBOX.value, "type": "Create", "meta.deleted": False}, limit=10
).sort("_id", -1):
fe = fg.add_entry()
fe.id(item["activity"]["object"].get("url"))
fe.link(href=item["activity"]["object"].get("url"))
@@ -537,11 +537,11 @@ def json_feed(path: str) -> Dict[str, Any]:
"""JSON Feed (https://jsonfeed.org/) document."""
data = []
for item in DB.activities.find(
{"box": Box.OUTBOX.value, "type": "Create"}, limit=50
):
{"box": Box.OUTBOX.value, "type": "Create", "meta.deleted": False}, limit=10
).sort("_id", -1):
data.append(
{
"id": item["id"],
"id": item["activity"]["id"],
"url": item["activity"]["object"].get("url"),
"content_html": item["activity"]["object"]["content"],
"content_text": html2text(item["activity"]["object"]["content"]),