Make AP 'to' always a list

merge-requests/154/merge
Jason Robinson 2019-08-11 01:29:30 +03:00
rodzic 9602b70c5d
commit b3b592385c
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -141,15 +141,15 @@ def handle_send(
try:
payload = handle_create_payload(entity, author_user, protocol, parent_user=parent_user)
if public:
payload["to"] = NAMESPACE_PUBLIC
payload["to"] = [NAMESPACE_PUBLIC]
payload["cc"] = [fid]
if isinstance(payload.get("object"), dict):
payload["object"]["to"] = NAMESPACE_PUBLIC
payload["object"]["to"] = [NAMESPACE_PUBLIC]
payload["object"]["cc"] = [fid]
else:
payload["to"] = fid
payload["to"] = [fid]
if isinstance(payload.get("object"), dict):
payload["object"]["to"] = fid
payload["object"]["to"] = [fid]
payload = json.dumps(payload).encode("utf-8")
except Exception as ex:
logger.error("handle_send - failed to generate private payload for %s: %s", fid, ex)