support pleroma-style outbox first
This commit is contained in:
parent
a1150b610f
commit
3a0cd6452c
1 changed files with 9 additions and 3 deletions
|
@ -44,11 +44,17 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
outbox = utils.http.request(outbox_url, headers=ACTIVITY_HEADERS,
|
outbox = utils.http.request(outbox_url, headers=ACTIVITY_HEADERS,
|
||||||
json=True)
|
json=True)
|
||||||
|
items = None
|
||||||
if "first" in outbox.data:
|
if "first" in outbox.data:
|
||||||
outbox = utils.http.request(outbox.data["first"],
|
if type(outbox.data["first"]) == dict:
|
||||||
|
items = outbox.data["first"]["orderedItems"]
|
||||||
|
else:
|
||||||
|
first = utils.http.request(outbox.data["first"],
|
||||||
headers=ACTIVITY_HEADERS, json=True)
|
headers=ACTIVITY_HEADERS, json=True)
|
||||||
|
items = first.data["orderedItems"]
|
||||||
|
else:
|
||||||
items = outbox.data["orderedItems"]
|
items = outbox.data["orderedItems"]
|
||||||
|
|
||||||
if items:
|
if items:
|
||||||
first_item = items[0]
|
first_item = items[0]
|
||||||
if first_item["type"] == "Announce":
|
if first_item["type"] == "Announce":
|
||||||
|
|
Loading…
Reference in a new issue