Bugfix in the custom API

This commit is contained in:
Thomas Sileo 2018-05-19 09:10:27 +02:00
parent df953dd1fa
commit 20656259e9

12
app.py
View file

@ -503,14 +503,24 @@ def new():
if tag['type'] == 'Mention':
cc.append(tag['href'])
if reply:
note = activitypub.Note(
cc=cc,
to=[to if to else config.AS_PUBLIC],
content=content, # TODO(tsileo): handle markdown
tag=tags,
source={'mediaType': 'text/markdown', 'content': source},
inReplyTo=reply.id,
inReplyTo=reply.id, # FIXME(tsieo): support None for inReplyTo?
)
else:
note = activitypub.Note(
cc=cc,
to=[to if to else config.AS_PUBLIC],
content=content, # TODO(tsileo): handle markdown
tag=tags,
source={'mediaType': 'text/markdown', 'content': source},
)
create = note.build_create()
print(create.to_dict())
create.post_to_outbox()