From f3bb90fffd4ff87ea54f65ef79be746ca356c0dd Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 13 Nov 2017 15:55:34 +1100 Subject: [PATCH] Accept in-reply-to, like-of, and repost-of at the micropub endpoint - currently they override each other, in the order I specified, but I think that's probably okay? --- micropub/views.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/micropub/views.py b/micropub/views.py index 5ce51c9..160d631 100644 --- a/micropub/views.py +++ b/micropub/views.py @@ -8,7 +8,7 @@ from urllib.parse import urljoin from entries.jobs import ping_hub, send_mentions from entries.models import Entry -from entries.kinds import Article, Note +from entries.kinds import Article, Note, Reply, Like, Repost from lemoncurry import utils from lemonauth import tokens @@ -35,6 +35,15 @@ class MicropubView(View): kind = Article if 'content' in post: entry.content = post['content'] + if 'in-reply-to' in post: + entry.cite = post['in-reply-to'] + kind = Reply + if 'like-of' in post: + entry.cite = post['like-of'] + kind = Like + if 'repost-of' in post: + entry.cite = post['repost-of'] + kind = Repost entry.kind = kind.id entry.save()