forked from forks/microblog.pub
Bugfix in the custom API
This commit is contained in:
parent
df953dd1fa
commit
20656259e9
1 changed files with 18 additions and 8 deletions
26
app.py
26
app.py
|
@ -503,14 +503,24 @@ def new():
|
||||||
if tag['type'] == 'Mention':
|
if tag['type'] == 'Mention':
|
||||||
cc.append(tag['href'])
|
cc.append(tag['href'])
|
||||||
|
|
||||||
note = activitypub.Note(
|
if reply:
|
||||||
cc=cc,
|
note = activitypub.Note(
|
||||||
to=[to if to else config.AS_PUBLIC],
|
cc=cc,
|
||||||
content=content, # TODO(tsileo): handle markdown
|
to=[to if to else config.AS_PUBLIC],
|
||||||
tag=tags,
|
content=content, # TODO(tsileo): handle markdown
|
||||||
source={'mediaType': 'text/markdown', 'content': source},
|
tag=tags,
|
||||||
inReplyTo=reply.id,
|
source={'mediaType': 'text/markdown', 'content': source},
|
||||||
)
|
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()
|
create = note.build_create()
|
||||||
print(create.to_dict())
|
print(create.to_dict())
|
||||||
create.post_to_outbox()
|
create.post_to_outbox()
|
||||||
|
|
Loading…
Reference in a new issue