mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Also hide following in the AP API if requested
This commit is contained in:
parent
468f17936f
commit
17a5257fea
2 changed files with 7 additions and 1 deletions
5
app.py
5
app.py
|
@ -772,6 +772,11 @@ def following():
|
||||||
|
|
||||||
if is_api_request():
|
if is_api_request():
|
||||||
_log_sig()
|
_log_sig()
|
||||||
|
if config.HIDE_FOLLOWING:
|
||||||
|
return jsonify(
|
||||||
|
**activitypub.simple_build_ordered_collection("following", [])
|
||||||
|
)
|
||||||
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
**activitypub.build_ordered_collection(
|
**activitypub.build_ordered_collection(
|
||||||
DB.activities,
|
DB.activities,
|
||||||
|
|
|
@ -24,6 +24,7 @@ from little_boxes.httpsig import HTTPSigAuth
|
||||||
|
|
||||||
from config import BASE_URL
|
from config import BASE_URL
|
||||||
from config import DB
|
from config import DB
|
||||||
|
from config import DEFAULT_CTX
|
||||||
from config import EXTRA_INBOXES
|
from config import EXTRA_INBOXES
|
||||||
from config import ID
|
from config import ID
|
||||||
from config import KEY
|
from config import KEY
|
||||||
|
@ -538,7 +539,7 @@ def embed_collection(total_items, first_page_id):
|
||||||
|
|
||||||
def simple_build_ordered_collection(col_name, data):
|
def simple_build_ordered_collection(col_name, data):
|
||||||
return {
|
return {
|
||||||
"@context": ap.COLLECTION_CTX,
|
"@context": DEFAULT_CTX,
|
||||||
"id": BASE_URL + "/" + col_name,
|
"id": BASE_URL + "/" + col_name,
|
||||||
"totalItems": len(data),
|
"totalItems": len(data),
|
||||||
"type": ap.ActivityType.ORDERED_COLLECTION.value,
|
"type": ap.ActivityType.ORDERED_COLLECTION.value,
|
||||||
|
|
Loading…
Reference in a new issue