fix: also ignore non-public notes on Update activity

This commit is contained in:
Julian Lam
2024-10-02 12:08:46 -04:00
parent f57758b9e5
commit 2713d13ca3

View File

@@ -76,6 +76,11 @@ inbox.create = async (req) => {
inbox.update = async (req) => { inbox.update = async (req) => {
const { actor, object } = req.body; const { actor, object } = req.body;
// Temporary, reject non-public notes.
if (![...object.to, ...object.cc].includes(activitypub._constants.publicAddress)) {
throw new Error('[[error:activitypub.not-implemented]]');
}
// Origin checking // Origin checking
const actorHostname = new URL(actor).hostname; const actorHostname = new URL(actor).hostname;
const objectHostname = new URL(object.id).hostname; const objectHostname = new URL(object.id).hostname;