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?
This commit is contained in:
parent
b446c7072c
commit
f3bb90fffd
1 changed files with 10 additions and 1 deletions
|
@ -8,7 +8,7 @@ from urllib.parse import urljoin
|
||||||
|
|
||||||
from entries.jobs import ping_hub, send_mentions
|
from entries.jobs import ping_hub, send_mentions
|
||||||
from entries.models import Entry
|
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 lemoncurry import utils
|
||||||
from lemonauth import tokens
|
from lemonauth import tokens
|
||||||
|
|
||||||
|
@ -35,6 +35,15 @@ class MicropubView(View):
|
||||||
kind = Article
|
kind = Article
|
||||||
if 'content' in post:
|
if 'content' in post:
|
||||||
entry.content = post['content']
|
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.kind = kind.id
|
||||||
entry.save()
|
entry.save()
|
||||||
|
|
Loading…
Reference in a new issue