aboutsummaryrefslogtreecommitdiff
path: root/modules/fediverse/ap_utils.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-08 16:07:35 +0100
committerGravatar jesopo2019-10-08 16:07:35 +0100
commit44a635b708fb386fdccf0891c3f1f7be3b801e8a (patch)
treefbdb30fef7fa8c588e8b0d34d00a2857369c3298 /modules/fediverse/ap_utils.py
parent!isupraw -> !tcpup (diff)
signature
prefer `url` over `id` as it's usually a more user-friendly url
Diffstat (limited to 'modules/fediverse/ap_utils.py')
-rw-r--r--modules/fediverse/ap_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/fediverse/ap_utils.py b/modules/fediverse/ap_utils.py
index dabf4f01..91e1be84 100644
--- a/modules/fediverse/ap_utils.py
+++ b/modules/fediverse/ap_utils.py
@@ -61,6 +61,7 @@ def format_note(actor, note, type="Create"):
retoot_url = note
retoot_instance = urllib.parse.urlparse(retoot_url).hostname
retoot = activity_request(retoot_url)
+ retoot_url = retoot.data.get("url", retoot.data["id"])
original_tooter = ap_actor.Actor(retoot.data["attributedTo"])
original_tooter.load()
@@ -72,7 +73,7 @@ def format_note(actor, note, type="Create"):
elif type == "Create":
content = utils.http.strip_html(note["content"])
- url = note["id"]
+ url = note.get("url", note["id"])
return (note.get("summary", None),
"%s: %s" % (actor.username, content), url)