mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Allow to reply to external activities
This commit is contained in:
parent
ff7211ae72
commit
8f3208175c
1 changed files with 11 additions and 3 deletions
14
app.py
14
app.py
|
@ -1356,12 +1356,20 @@ def admin_new():
|
||||||
reply_id = None
|
reply_id = None
|
||||||
content = ""
|
content = ""
|
||||||
thread = []
|
thread = []
|
||||||
|
print(request.args)
|
||||||
if request.args.get("reply"):
|
if request.args.get("reply"):
|
||||||
data = DB.activities.find_one({"activity.object.id": request.args.get("reply")})
|
data = DB.activities.find_one({"activity.object.id": request.args.get("reply")})
|
||||||
if not data:
|
if data:
|
||||||
abort(400)
|
|
||||||
|
|
||||||
reply = ap.parse_activity(data["activity"])
|
reply = ap.parse_activity(data["activity"])
|
||||||
|
else:
|
||||||
|
data = dict(
|
||||||
|
meta={},
|
||||||
|
activity=dict(
|
||||||
|
object=get_backend().fetch_iri(request.args.get("reply"))
|
||||||
|
),
|
||||||
|
)
|
||||||
|
reply = ap.parse_activity(data["activity"]["object"])
|
||||||
|
|
||||||
reply_id = reply.id
|
reply_id = reply.id
|
||||||
if reply.ACTIVITY_TYPE == ActivityType.CREATE:
|
if reply.ACTIVITY_TYPE == ActivityType.CREATE:
|
||||||
reply_id = reply.get_object().id
|
reply_id = reply.get_object().id
|
||||||
|
|
Loading…
Reference in a new issue